!function(t,e){"use strict";t(window).on("elementor/frontend/init",(function(t){var e,s=elementorModules.frontend.handlers.Base;e=s.extend({bindEvents:function(){this.run()},getDefaultSettings:function(){return{resize:!0,useWorker:!0}},onElementChange:debounce((function(t){-1!==t.indexOf("ep_widget_cf_")&&this.run()}),400),settings:function(t){return this.getElementSettings("ep_widget_cf_"+t)},randomInRange:function(t,e){return Math.random()*(e-t)+t},run:function(){var t=this.getDefaultSettings(),e=this.$element;if("yes"===this.settings("confetti")){if(this.settings("z_index")&&(t.zIndex=this.settings("z_index")),this.settings("particle_count.size")&&(t.particleCount=this.settings("particle_count.size")||100),this.settings("start_velocity.size")&&(t.startVelocity=this.settings("start_velocity.size")||45),this.settings("spread.size")&&(t.spread=this.settings("spread.size")||70),this.settings("colors")){var s=this.settings("colors");t.colors=s.split(",")}if(this.settings("shapes")){var n=this.settings("shapes");t.shapes=n.split(/,|\|/)}if("emoji"==this.settings("shape_type")&&this.settings("shapes_emoji")){n=this.settings("shapes_emoji");let e=[];n.split(/,|\|/).forEach((function(t,s){e[s]=confetti.shapeFromText({text:t})})),t.shapes=e}if("svg"==this.settings("shape_type")&&this.settings("shapes_svg")){let e=this.settings("shapes_svg"),s=[];e.split("|").forEach((function(t,e){s[e]=confetti.shapeFromPath({path:t,matrix:[.03597122302158273,0,0,.03597122302158273,-4.856115107913669,-5.071942446043165]})})),t.shapes=s}this.settings("scalar.size")&&(t.scalar=this.settings("scalar.size")||1),this.settings("origin")&&(this.settings("origin_x.size")||this.settings("origin_y.size"))&&(t.origin={x:this.settings("origin_x.size")||.5,y:this.settings("origin_y.size")||.6}),this.settings("angle.size")&&(t.angle=this.settings("angle.size")||90);var i=this,r=function(){if("random"==i.settings("type")&&(t.angle=i.randomInRange(55,i.settings("angle.size")||90),t.spread=i.randomInRange(50,i.settings("spread.size")||70),t.particleCount=i.randomInRange(55,i.settings("particle_count.size")||100)),"fireworks"==i.settings("type"))var e=i.settings("fireworks_duration.size")||1500,r=Date.now()+e,a={startVelocity:i.settings("start_velocity.size")||30,spread:i.settings("spread.size")||360,shapes:i.settings("shapes")?n.split(","):["circle","circle","square"],ticks:60,zIndex:i.settings("z_index")||0},o=setInterval((function(){var t=r-Date.now();if(t<=0)return clearInterval(o);var s=t/e*50;confetti(Object.assign({},a,{particleCount:s,origin:{x:i.randomInRange(.1,.3),y:Math.random()-.2}})),confetti(Object.assign({},a,{particleCount:s,origin:{x:i.randomInRange(.7,.9),y:Math.random()-.2}}))}),250);if("school-pride"==i.settings("type")){e=i.settings("fireworks_duration.size")||1500;var g=Date.now()+e;!function t(){confetti({particleCount:i.settings("particle_count.size")||2,angle:i.settings("angle.size")||60,spread:i.settings("spread.size")||55,shapes:i.settings("shapes")?n.split(","):["circle","circle","square"],origin:{x:0},colors:s.split(",")}),confetti({particleCount:i.settings("particle_count.size")||2,angle:2*(i.settings("angle.size")||60),spread:i.settings("spread.size")||55,shapes:i.settings("shapes")?n.split(","):["circle","circle","square"],origin:{x:1},colors:s.split(",")}),Date.now()0&&requestAnimationFrame(t)}(),setInterval((function(){}),5e3)}"basic"!=i.settings("type")&&"random"!=i.settings("type")||(i.instance=confetti(t))};"yes"==this.settings("confetti")&&("click"==this.settings("trigger_type")?jQuery(this.settings("trigger_selector")).on("click",(function(){r()})):"mouseenter"==this.settings("trigger_type")?jQuery(this.settings("trigger_selector")).on("mouseenter",(function(){r()})):"ajax-success"==this.settings("trigger_type")?jQuery(document).ajaxComplete((function(t,e,s){r()})):"delay"==this.settings("trigger_type")?setTimeout((function(){r()}),this.settings("trigger_delay.size")?this.settings("trigger_delay.size"):1e3):"onview"==this.settings("trigger_type")?elementorFrontend.waypoint(e,(function(){r()}),{offset:"80%"}):r())}}}),elementorFrontend.hooks.addAction("frontend/element_ready/widget",(function(t){elementorFrontend.elementsHandler.addHandler(e,{$element:t})})),elementorFrontend.hooks.addAction("frontend/element_ready/section",(function(t){elementorFrontend.elementsHandler.addHandler(e,{$element:t})})),elementorFrontend.hooks.addAction("frontend/element_ready/container",(function(t){elementorFrontend.elementsHandler.addHandler(e,{$element:t})}))}))}(jQuery,window.elementorFrontend); (function ($){ const wdtInteractiveShowcaseWidgetHandler=function($scope, $){ const $showcaseItem=$scope.find('.wdt-interactive-showcase-container'); const $hover_and_click=$showcaseItem.data('click'); var hover_content_section=$showcaseItem.find('ul li'); var image_content_section=$showcaseItem.find('.wdt-interactive-showcase-content-wrapper').find('div'); $showcaseItem.find('ul li:first-child').addClass('wdt-interactive-showcase-active'); $showcaseItem.find('.wdt-interactive-showcase-content-wrapper').find('div:first-child').addClass('wdt-interactive-showcase-active'); if($hover_and_click){ hover_content_section.click(function(){ var content_id_name=$(this).attr('id'); if(! ($(this).hasClass('wdt-interactive-showcase-active'))){ $showcaseItem.find('ul li').removeClass('wdt-interactive-showcase-active'); $showcaseItem.find('.wdt-interactive-showcase-content-wrapper').find('div').removeClass('wdt-interactive-showcase-active'); $(this).addClass('wdt-interactive-showcase-active'); image_content_section.each(function(){ var this_image=$(this); var image_id_name=this_image.attr('id'); if(image_content_section.is('#' + content_id_name)){ if(image_id_name==content_id_name){ this_image.addClass('wdt-interactive-showcase-active'); }else{ this_image.removeClass('wdt-interactive-showcase-active'); }} }); }}); }else{ hover_content_section.mouseover(function(){ var content_id_name=$(this).attr('id'); if(! ($(this).hasClass('wdt-interactive-showcase-active'))){ $showcaseItem.find('ul li').removeClass('wdt-interactive-showcase-active'); $showcaseItem.find('.wdt-interactive-showcase-content-wrapper').find('div').removeClass('wdt-interactive-showcase-active'); $(this).addClass('wdt-interactive-showcase-active'); image_content_section.each(function(){ var this_image=$(this); var image_id_name=this_image.attr('id'); if(image_content_section.is('#' + content_id_name)){ if(image_id_name==content_id_name){ this_image.addClass('wdt-interactive-showcase-active'); }else{ this_image.removeClass('wdt-interactive-showcase-active'); }} }); }}); }}; $(window).on('elementor/frontend/init', function (){ elementorFrontend.hooks.addAction('frontend/element_ready/wdt-interactive-showcase.default', wdtInteractiveShowcaseWidgetHandler); }); })(jQuery); !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(m){var i=/\+/g;function x(e){return v.raw?e:encodeURIComponent(e)}function g(e,n){var o=v.raw?e:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(i," ")),v.json?JSON.parse(e):e}catch(e){}}(e);return m.isFunction(n)?n(o):o}var v=m.cookie=function(e,n,o){if(1(a||r.height())},_setFocus:function(){(n.st.focus?n.content.find(n.st.focus).eq(0):n.wrap).focus()},_onFocusIn:function(b){if(b.target!==n.wrap[0]&&!a.contains(n.wrap[0],b.target))return n._setFocus(),!1},_parseMarkup:function(b,c,d){var e;d.data&&(c=a.extend(d.data,c)),y(f,[b,c,d]),a.each(c,function(c,d){if(d===undefined||d===!1)return!0;e=c.split("_");if(e.length>1){var f=b.find(j+"-"+e[0]);if(f.length>0){var g=e[1];g==="replaceWith"?f[0]!==d[0]&&f.replaceWith(d):g==="img"?f.is("img")?f.attr("src",d):f.replaceWith(a("").attr("src",d).attr("class",f.attr("class"))):f.attr(e[1],d)}}else b.find(j+"-"+c).html(d)})},_getScrollbarSize:function(){if(n.scrollbarSize===undefined){var a=document.createElement("div");a.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(a),n.scrollbarSize=a.offsetWidth-a.clientWidth,document.body.removeChild(a)}return n.scrollbarSize}},a.magnificPopup={instance:null,proto:o.prototype,modules:[],open:function(b,c){return A(),b?b=a.extend(!0,{},b):b={},b.isObj=!0,b.index=c||0,this.instance.open(b)},close:function(){return a.magnificPopup.instance&&a.magnificPopup.instance.close()},registerModule:function(b,c){c.options&&(a.magnificPopup.defaults[b]=c.options),a.extend(this.proto,c.proto),this.modules.push(b)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},a.fn.magnificPopup=function(b){A();var c=a(this);if(typeof b=="string")if(b==="open"){var d,e=p?c.data("magnificPopup"):c[0].magnificPopup,f=parseInt(arguments[1],10)||0;e.items?d=e.items[f]:(d=c,e.delegate&&(d=d.find(e.delegate)),d=d.eq(f)),n._openClick({mfpEl:d},c,e)}else n.isOpen&&n[b].apply(n,Array.prototype.slice.call(arguments,1));else b=a.extend(!0,{},b),p?c.data("magnificPopup",b):c[0].magnificPopup=b,n.addGroup(c,b);return c};var C="inline",D,E,F,G=function(){F&&(E.after(F.addClass(D)).detach(),F=null)};a.magnificPopup.registerModule(C,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){n.types.push(C),w(b+"."+C,function(){G()})},getInline:function(b,c){G();if(b.src){var d=n.st.inline,e=a(b.src);if(e.length){var f=e[0].parentNode;f&&f.tagName&&(E||(D=d.hiddenClass,E=x(D),D="mfp-"+D),F=e.after(E).detach().removeClass(D)),n.updateStatus("ready")}else n.updateStatus("error",d.tNotFound),e=a("
");return b.inlineElement=e,e}return n.updateStatus("ready"),n._parseMarkup(c,{},b),c}}});var H="ajax",I,J=function(){I&&a(document.body).removeClass(I)},K=function(){J(),n.req&&n.req.abort()};a.magnificPopup.registerModule(H,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'The content could not be loaded.'},proto:{initAjax:function(){n.types.push(H),I=n.st.ajax.cursor,w(b+"."+H,K),w("BeforeChange."+H,K)},getAjax:function(b){I&&a(document.body).addClass(I),n.updateStatus("loading");var c=a.extend({url:b.src,success:function(c,d,e){var f={data:c,xhr:e};y("ParseAjax",f),n.appendContent(a(f.data),H),b.finished=!0,J(),n._setFocus(),setTimeout(function(){n.wrap.addClass(k)},16),n.updateStatus("ready"),y("AjaxContentAdded")},error:function(){J(),b.finished=b.loadError=!0,n.updateStatus("error",n.st.ajax.tError.replace("%url%",b.src))}},n.st.ajax.settings);return n.req=a.ajax(c),""}}});var L,M=function(b){if(b.data&&b.data.title!==undefined)return b.data.title;var c=n.st.image.titleSrc;if(c){if(a.isFunction(c))return c.call(n,b);if(b.el)return b.el.attr(c)||""}return""};a.magnificPopup.registerModule("image",{options:{markup:'
',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'The image could not be loaded.'},proto:{initImage:function(){var c=n.st.image,d=".image";n.types.push("image"),w(g+d,function(){n.currItem.type==="image"&&c.cursor&&a(document.body).addClass(c.cursor)}),w(b+d,function(){c.cursor&&a(document.body).removeClass(c.cursor),r.off("resize"+j)}),w("Resize"+d,n.resizeImage),n.isLowIE&&w("AfterChange",n.resizeImage)},resizeImage:function(){var a=n.currItem;if(!a||!a.img)return;if(n.st.image.verticalFit){var b=0;n.isLowIE&&(b=parseInt(a.img.css("padding-top"),10)+parseInt(a.img.css("padding-bottom"),10)),a.img.css("max-height",n.wH-b)}},_onImageHasSize:function(a){a.img&&(a.hasSize=!0,L&&clearInterval(L),a.isCheckingImgSize=!1,y("ImageHasSize",a),a.imgHidden&&(n.content&&n.content.removeClass("mfp-loading"),a.imgHidden=!1))},findImageSize:function(a){var b=0,c=a.img[0],d=function(e){L&&clearInterval(L),L=setInterval(function(){if(c.naturalWidth>0){n._onImageHasSize(a);return}b>200&&clearInterval(L),b++,b===3?d(10):b===40?d(50):b===100&&d(500)},e)};d(1)},getImage:function(b,c){var d=0,e=function(){b&&(b.img[0].complete?(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("ready")),b.hasSize=!0,b.loaded=!0,y("ImageLoadComplete")):(d++,d<200?setTimeout(e,100):f()))},f=function(){b&&(b.img.off(".mfploader"),b===n.currItem&&(n._onImageHasSize(b),n.updateStatus("error",g.tError.replace("%url%",b.src))),b.hasSize=!0,b.loaded=!0,b.loadError=!0)},g=n.st.image,h=c.find(".mfp-img");if(h.length){var i=document.createElement("img");i.className="mfp-img",b.el&&b.el.find("img").length&&(i.alt=b.el.find("img").attr("alt")),b.img=a(i).on("load.mfploader",e).on("error.mfploader",f),i.src=b.src,h.is("img")&&(b.img=b.img.clone()),i=b.img[0],i.naturalWidth>0?b.hasSize=!0:i.width||(b.hasSize=!1)}return n._parseMarkup(c,{title:M(b),img_replaceWith:b.img},b),n.resizeImage(),b.hasSize?(L&&clearInterval(L),b.loadError?(c.addClass("mfp-loading"),n.updateStatus("error",g.tError.replace("%url%",b.src))):(c.removeClass("mfp-loading"),n.updateStatus("ready")),c):(n.updateStatus("loading"),b.loading=!0,b.hasSize||(b.imgHidden=!0,c.addClass("mfp-loading"),n.findImageSize(b)),c)}}});var N,O=function(){return N===undefined&&(N=document.createElement("p").style.MozTransform!==undefined),N};a.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(a){return a.is("img")?a:a.find("img")}},proto:{initZoom:function(){var a=n.st.zoom,d=".zoom",e;if(!a.enabled||!n.supportsTransition)return;var f=a.duration,g=function(b){var c=b.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),d="all "+a.duration/1e3+"s "+a.easing,e={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},f="transition";return e["-webkit-"+f]=e["-moz-"+f]=e["-o-"+f]=e[f]=d,c.css(e),c},h=function(){n.content.css("visibility","visible")},i,j;w("BuildControls"+d,function(){if(n._allowZoom()){clearTimeout(i),n.content.css("visibility","hidden"),e=n._getItemToZoom();if(!e){h();return}j=g(e),j.css(n._getOffset()),n.wrap.append(j),i=setTimeout(function(){j.css(n._getOffset(!0)),i=setTimeout(function(){h(),setTimeout(function(){j.remove(),e=j=null,y("ZoomAnimationEnded")},16)},f)},16)}}),w(c+d,function(){if(n._allowZoom()){clearTimeout(i),n.st.removalDelay=f;if(!e){e=n._getItemToZoom();if(!e)return;j=g(e)}j.css(n._getOffset(!0)),n.wrap.append(j),n.content.css("visibility","hidden"),setTimeout(function(){j.css(n._getOffset())},16)}}),w(b+d,function(){n._allowZoom()&&(h(),j&&j.remove(),e=null)})},_allowZoom:function(){return n.currItem.type==="image"},_getItemToZoom:function(){return n.currItem.hasSize?n.currItem.img:!1},_getOffset:function(b){var c;b?c=n.currItem.img:c=n.st.zoom.opener(n.currItem.el||n.currItem);var d=c.offset(),e=parseInt(c.css("padding-top"),10),f=parseInt(c.css("padding-bottom"),10);d.top-=a(window).scrollTop()-e;var g={width:c.width(),height:(p?c.innerHeight():c[0].offsetHeight)-f-e};return O()?g["-moz-transform"]=g.transform="translate("+d.left+"px,"+d.top+"px)":(g.left=d.left,g.top=d.top),g}}});var P="iframe",Q="//about:blank",R=function(a){if(n.currTemplate[P]){var b=n.currTemplate[P].find("iframe");b.length&&(a||(b[0].src=Q),n.isIE8&&b.css("display",a?"block":"none"))}};a.magnificPopup.registerModule(P,{options:{markup:'
',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){n.types.push(P),w("BeforeChange",function(a,b,c){b!==c&&(b===P?R():c===P&&R(!0))}),w(b+"."+P,function(){R()})},getIframe:function(b,c){var d=b.src,e=n.st.iframe;a.each(e.patterns,function(){if(d.indexOf(this.index)>-1)return this.id&&(typeof this.id=="string"?d=d.substr(d.lastIndexOf(this.id)+this.id.length,d.length):d=this.id.call(this,d)),d=this.src.replace("%id%",d),!1});var f={};return e.srcAction&&(f[e.srcAction]=d),n._parseMarkup(c,f,b),n.updateStatus("ready"),c}}});var S=function(a){var b=n.items.length;return a>b-1?a-b:a<0?b+a:a},T=function(a,b,c){return a.replace(/%curr%/gi,b+1).replace(/%total%/gi,c)};a.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var c=n.st.gallery,d=".mfp-gallery";n.direction=!0;if(!c||!c.enabled)return!1;u+=" mfp-gallery",w(g+d,function(){c.navigateByImgClick&&n.wrap.on("click"+d,".mfp-img",function(){if(n.items.length>1)return n.next(),!1}),s.on("keydown"+d,function(a){a.keyCode===37?n.prev():a.keyCode===39&&n.next()})}),w("UpdateStatus"+d,function(a,b){b.text&&(b.text=T(b.text,n.currItem.index,n.items.length))}),w(f+d,function(a,b,d,e){var f=n.items.length;d.counter=f>1?T(c.tCounter,e.index,f):""}),w("BuildControls"+d,function(){if(n.items.length>1&&c.arrows&&!n.arrowLeft){var b=c.arrowMarkup,d=n.arrowLeft=a(b.replace(/%title%/gi,c.tPrev).replace(/%dir%/gi,"left")).addClass(m),e=n.arrowRight=a(b.replace(/%title%/gi,c.tNext).replace(/%dir%/gi,"right")).addClass(m);d.click(function(){n.prev()}),e.click(function(){n.next()}),n.container.append(d.add(e))}}),w(h+d,function(){n._preloadTimeout&&clearTimeout(n._preloadTimeout),n._preloadTimeout=setTimeout(function(){n.preloadNearbyImages(),n._preloadTimeout=null},16)}),w(b+d,function(){s.off(d),n.wrap.off("click"+d),n.arrowRight=n.arrowLeft=null})},next:function(){n.direction=!0,n.index=S(n.index+1),n.updateItemHTML()},prev:function(){n.direction=!1,n.index=S(n.index-1),n.updateItemHTML()},goTo:function(a){n.direction=a>=n.index,n.index=a,n.updateItemHTML()},preloadNearbyImages:function(){var a=n.st.gallery.preload,b=Math.min(a[0],n.items.length),c=Math.min(a[1],n.items.length),d;for(d=1;d<=(n.direction?c:b);d++)n._preloadItem(n.index+d);for(d=1;d<=(n.direction?b:c);d++)n._preloadItem(n.index-d)},_preloadItem:function(b){b=S(b);if(n.items[b].preloaded)return;var c=n.items[b];c.parsed||(c=n.parseEl(b)),y("LazyLoad",c),c.type==="image"&&(c.img=a('').on("load.mfploader",function(){c.hasSize=!0}).on("error.mfploader",function(){c.hasSize=!0,c.loadError=!0,y("LazyLoadError",c)}).attr("src",c.src)),c.preloaded=!0}}});var U="retina";a.magnificPopup.registerModule(U,{options:{replaceSrc:function(a){return a.src.replace(/\.\w+$/,function(a){return"@2x"+a})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var a=n.st.retina,b=a.ratio;b=isNaN(b)?b():b,b>1&&(w("ImageHasSize."+U,function(a,c){c.img.css({"max-width":c.img[0].naturalWidth/b,width:"100%"})}),w("ElementParse."+U,function(c,d){d.src=a.replaceSrc(d,b)}))}}}}),A()}); (function ($){ const wdtPopupBoxWidgetHandler=function($scope){ const instance=new wdtPopupBoxWidgetHandlerInit($scope); instance.init(); }; const wdtPopupBoxWidgetHandlerInit=function($scope){ const $self=this; const $settings=$scope.find('.wdt-popup-box-trigger-holder').data('settings'); const $module_ref_id=$settings['module_ref_id']; const $popup_class=$settings['popup_class']; const $trigger_type=$settings['trigger_type'] ? $settings['trigger_type']:'on-click'; const $on_load_delay=$settings['on_load_delay'] ? +$settings['on_load_delay']['size']:200; const $on_load_after=$settings['on_load_after'] ? +$settings['on_load_after']['size']:1; const $external_class=$settings['external_class'] ? $settings['external_class']:false; const $external_id=$settings['external_id'] ? $settings['external_id']:false; const $show_close_Button=$settings['show_close_Button'] ? $settings['show_close_Button']:false; const $esc_to_exit=$settings['esc_to_exit'] ? $settings['esc_to_exit']:false; const $click_to_exit=$settings['click_to_exit'] ? $settings['click_to_exit']:false; const $mfp_src=$settings['mfp_src'] ? $settings['mfp_src']:false; const $mfp_type=$settings['mfp_type'] ? $settings['mfp_type']:false; const $mfp_button_position=($mfp_type==='image') ? true:false; let $trigger_element=false; $self.init=function(){ if($trigger_type==='on-load'){ $self.onLoadInit() }else if($trigger_type==='on-click'){ $trigger_element=$scope.find('.wdt-popup-box-trigger-item'); $self.onClickInit(); }else if($trigger_type==='external-class'){ $trigger_element=$($external_class); $self.onClickInit(); }else if($trigger_type==='external-id'){ $trigger_element=$($external_id); $self.onClickInit(); }}; $self.onLoadInit=function(){ if($on_load_after===0){ $.removeCookie($module_ref_id, { path: "/" }); } if(!$.cookie($module_ref_id)){ setTimeout(function (){ $.magnificPopup.open({ items: { src: $mfp_src, type: $mfp_type, }, removalDelay: 500, showCloseBtn: $show_close_Button, enableEscapeKey: $esc_to_exit, closeOnBgClick: $click_to_exit, mainClass: $popup_class, closeBtnInside: $mfp_button_position }); if($on_load_after > 0){ $.cookie($module_ref_id, $on_load_after, { expires: $on_load_after, path: "/", }); }else{ $.removeCookie($module_ref_id); }}, $on_load_delay); }}; $self.onClickInit=function(){ $trigger_element.magnificPopup({ items: { src: $mfp_src, type: $mfp_type, }, removalDelay: 500, showCloseBtn: $show_close_Button, enableEscapeKey: $esc_to_exit, closeOnBgClick: $click_to_exit, mainClass: $popup_class, closeBtnInside: $mfp_button_position }); };}; $(window).on('elementor/frontend/init', function (){ elementorFrontend.hooks.addAction('frontend/element_ready/wdt-popup-box.default', wdtPopupBoxWidgetHandler); }); })(jQuery); !function(t,s){"use strict";t(window).on("elementor/frontend/init",(function(){var t,s=elementorModules.frontend.handlers.Base;t=s.extend({bindEvents:function(){this.run()},getDefaultSettings:function(){return{media:!1,easing:1,viewport:1}},onElementChange:debounce((function(t){-1!==t.indexOf("ep_parallax_effects")&&this.run()}),400),settings:function(t){return this.getElementSettings("ep_parallax_effects_"+t)},run:function(){var t=this.getDefaultSettings(),s=this.findElement(".elementor-widget-container").get(0);jQuery(this.$element).hasClass("elementor-section")&&(s=this.$element.get(0)),this.settings("y")&&(this.settings("y_custom_show")?t.y=this.settings("y_custom_value"):(this.settings("y_start.size")||this.settings("y_end.size"))&&(t.y=[this.settings("y_start.size")||0,this.settings("y_end.size")||0])),this.settings("x")&&(this.settings("x_custom_show")?t.x=this.settings("x_custom_value"):(this.settings("x_start.size")||this.settings("x_end.size"))&&(t.x=[this.settings("x_start.size"),this.settings("x_end.size")])),this.settings("opacity_toggole")&&(this.settings("opacity_custom_show")?t.opacity=this.settings("opacity_custom_value"):"htov"===this.settings("opacity")?t.opacity=[0,1]:"vtoh"===this.settings("opacity")&&(t.opacity=[1,0])),this.settings("blur")&&(this.settings("blur_start.size")||this.settings("blur_end.size"))&&(t.blur=[this.settings("blur_start.size")||0,this.settings("blur_end.size")||0]),this.settings("rotate")&&(this.settings("rotate_start.size")||this.settings("rotate_end.size"))&&(t.rotate=[this.settings("rotate_start.size")||0,this.settings("rotate_end.size")||0]),this.settings("scale")&&(this.settings("scale_start.size")||this.settings("scale_end.size"))&&(t.scale=[this.settings("scale_start.size")||1,this.settings("scale_end.size")||1]),this.settings("hue")&&this.settings("hue_value.size")&&(t.hue=this.settings("hue_value.size")),this.settings("sepia")&&this.settings("sepia_value.size")&&(t.sepia=this.settings("sepia_value.size")),this.settings("viewport")&&this.settings("viewport_start")&&(t.start=this.settings("viewport_start")),this.settings("viewport")&&this.settings("viewport_end")&&(t.end=this.settings("viewport_end")),this.settings("media_query")&&this.settings("media_query")&&(t.media=this.settings("media_query")),this.settings("easing")&&this.settings("easing_value.size")&&(t.easing=this.settings("easing_value.size")),this.settings("target")&&"section"===this.settings("target")&&(t.target=".elementor-section.elementor-element-"+jQuery(s).closest("section").data("id")),this.settings("show")&&(this.settings("y")||this.settings("x")||this.settings("opacity")||this.settings("blur")||this.settings("rotate")||this.settings("scale")||this.settings("hue")||this.settings("sepia")||this.settings("viewport")||this.settings("media_query")||this.settings("easing")||this.settings("target"))&&bdtUIkit.parallax(s,t)}}),elementorFrontend.hooks.addAction("frontend/element_ready/section",(function(s){elementorFrontend.elementsHandler.addHandler(t,{$element:s})})),elementorFrontend.hooks.addAction("frontend/element_ready/widget",(function(s){elementorFrontend.elementsHandler.addHandler(t,{$element:s})}))}))}(jQuery,window.elementorFrontend); var pJS=function(e,a){var t=document.querySelector("#"+e+" > .particles-js-canvas-el");this.pJS={canvas:{el:t,w:t.offsetWidth,h:t.offsetHeight},particles:{number:{value:400,density:{enable:!0,value_area:800}},color:{value:"#fff"},shape:{type:"circle",stroke:{width:0,color:"#ff0000"},polygon:{nb_sides:5},image:{src:"",width:100,height:100}},opacity:{value:1,random:!1,anim:{enable:!1,speed:2,opacity_min:0,sync:!1}},size:{value:20,random:!1,anim:{enable:!1,speed:20,size_min:0,sync:!1}},line_linked:{enable:!0,distance:100,color:"#fff",opacity:1,width:1},move:{enable:!0,speed:2,direction:"none",random:!1,straight:!1,out_mode:"out",bounce:!1,attract:{enable:!1,rotateX:3e3,rotateY:3e3}},array:[]},interactivity:{detect_on:"canvas",events:{onhover:{enable:!0,mode:"grab"},onclick:{enable:!0,mode:"push"},resize:!0},modes:{grab:{distance:100,line_linked:{opacity:1}},bubble:{distance:200,size:80,duration:.4},repulse:{distance:200,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}},mouse:{}},retina_detect:!1,fn:{interact:{},modes:{},vendors:{}},tmp:{}};var i=this.pJS;a&&Object.deepExtend(i,a),i.tmp.obj={size_value:i.particles.size.value,size_anim_speed:i.particles.size.anim.speed,move_speed:i.particles.move.speed,line_linked_distance:i.particles.line_linked.distance,line_linked_width:i.particles.line_linked.width,mode_grab_distance:i.interactivity.modes.grab.distance,mode_bubble_distance:i.interactivity.modes.bubble.distance,mode_bubble_size:i.interactivity.modes.bubble.size,mode_repulse_distance:i.interactivity.modes.repulse.distance},i.fn.retinaInit=function(){i.retina_detect&&window.devicePixelRatio>1?(i.canvas.pxratio=window.devicePixelRatio,i.tmp.retina=!0):(i.canvas.pxratio=1,i.tmp.retina=!1),i.canvas.w=i.canvas.el.offsetWidth*i.canvas.pxratio,i.canvas.h=i.canvas.el.offsetHeight*i.canvas.pxratio,i.particles.size.value=i.tmp.obj.size_value*i.canvas.pxratio,i.particles.size.anim.speed=i.tmp.obj.size_anim_speed*i.canvas.pxratio,i.particles.move.speed=i.tmp.obj.move_speed*i.canvas.pxratio,i.particles.line_linked.distance=i.tmp.obj.line_linked_distance*i.canvas.pxratio,i.interactivity.modes.grab.distance=i.tmp.obj.mode_grab_distance*i.canvas.pxratio,i.interactivity.modes.bubble.distance=i.tmp.obj.mode_bubble_distance*i.canvas.pxratio,i.particles.line_linked.width=i.tmp.obj.line_linked_width*i.canvas.pxratio,i.interactivity.modes.bubble.size=i.tmp.obj.mode_bubble_size*i.canvas.pxratio,i.interactivity.modes.repulse.distance=i.tmp.obj.mode_repulse_distance*i.canvas.pxratio},i.fn.canvasInit=function(){i.canvas.ctx=i.canvas.el.getContext("2d")},i.fn.canvasSize=function(){i.canvas.el.width=i.canvas.w,i.canvas.el.height=i.canvas.h,i&&i.interactivity.events.resize&&window.addEventListener("resize",(function(){i.canvas.w=i.canvas.el.offsetWidth,i.canvas.h=i.canvas.el.offsetHeight,i.tmp.retina&&(i.canvas.w*=i.canvas.pxratio,i.canvas.h*=i.canvas.pxratio),i.canvas.el.width=i.canvas.w,i.canvas.el.height=i.canvas.h,i.particles.move.enable||(i.fn.particlesEmpty(),i.fn.particlesCreate(),i.fn.particlesDraw(),i.fn.vendors.densityAutoParticles()),i.fn.vendors.densityAutoParticles()}))},i.fn.canvasPaint=function(){i.canvas.ctx.fillRect(0,0,i.canvas.w,i.canvas.h)},i.fn.canvasClear=function(){i.canvas.ctx.clearRect(0,0,i.canvas.w,i.canvas.h)},i.fn.particle=function(e,a,t){if(this.radius=(i.particles.size.random?Math.random():1)*i.particles.size.value,i.particles.size.anim.enable&&(this.size_status=!1,this.vs=i.particles.size.anim.speed/100,i.particles.size.anim.sync||(this.vs=this.vs*Math.random())),this.x=t?t.x:Math.random()*i.canvas.w,this.y=t?t.y:Math.random()*i.canvas.h,this.x>i.canvas.w-2*this.radius?this.x=this.x-this.radius:this.x<2*this.radius&&(this.x=this.x+this.radius),this.y>i.canvas.h-2*this.radius?this.y=this.y-this.radius:this.y<2*this.radius&&(this.y=this.y+this.radius),i.particles.move.bounce&&i.fn.vendors.checkOverlap(this,t),this.color={},"object"==typeof e.value)if(e.value instanceof Array){var s=e.value[Math.floor(Math.random()*i.particles.color.value.length)];this.color.rgb=hexToRgb(s)}else null!=e.value.r&&null!=e.value.g&&null!=e.value.b&&(this.color.rgb={r:e.value.r,g:e.value.g,b:e.value.b}),null!=e.value.h&&null!=e.value.s&&null!=e.value.l&&(this.color.hsl={h:e.value.h,s:e.value.s,l:e.value.l});else"random"==e.value?this.color.rgb={r:Math.floor(256*Math.random())+0,g:Math.floor(256*Math.random())+0,b:Math.floor(256*Math.random())+0}:"string"==typeof e.value&&(this.color=e,this.color.rgb=hexToRgb(this.color.value));this.opacity=(i.particles.opacity.random?Math.random():1)*i.particles.opacity.value,i.particles.opacity.anim.enable&&(this.opacity_status=!1,this.vo=i.particles.opacity.anim.speed/100,i.particles.opacity.anim.sync||(this.vo=this.vo*Math.random()));var n={};switch(i.particles.move.direction){case"top":n={x:0,y:-1};break;case"top-right":n={x:.5,y:-.5};break;case"right":n={x:1,y:-0};break;case"bottom-right":n={x:.5,y:.5};break;case"bottom":n={x:0,y:1};break;case"bottom-left":n={x:-.5,y:1};break;case"left":n={x:-1,y:0};break;case"top-left":n={x:-.5,y:-.5};break;default:n={x:0,y:0}}i.particles.move.straight?(this.vx=n.x,this.vy=n.y,i.particles.move.random&&(this.vx=this.vx*Math.random(),this.vy=this.vy*Math.random())):(this.vx=n.x+Math.random()-.5,this.vy=n.y+Math.random()-.5),this.vx_i=this.vx,this.vy_i=this.vy;var r=i.particles.shape.type;if("object"==typeof r){if(r instanceof Array){var c=r[Math.floor(Math.random()*r.length)];this.shape=c}}else this.shape=r;if("image"==this.shape){var o=i.particles.shape;this.img={src:o.image.src,ratio:o.image.width/o.image.height},this.img.ratio||(this.img.ratio=1),"svg"==i.tmp.img_type&&null!=i.tmp.source_svg&&(i.fn.vendors.createSvgImg(this),i.tmp.pushing&&(this.img.loaded=!1))}},i.fn.particle.prototype.draw=function(){var e=this;if(null!=e.radius_bubble)var a=e.radius_bubble;else a=e.radius;if(null!=e.opacity_bubble)var t=e.opacity_bubble;else t=e.opacity;if(e.color.rgb)var s="rgba("+e.color.rgb.r+","+e.color.rgb.g+","+e.color.rgb.b+","+t+")";else s="hsla("+e.color.hsl.h+","+e.color.hsl.s+"%,"+e.color.hsl.l+"%,"+t+")";switch(i.canvas.ctx.fillStyle=s,i.canvas.ctx.beginPath(),e.shape){case"circle":i.canvas.ctx.arc(e.x,e.y,a,0,2*Math.PI,!1);break;case"edge":i.canvas.ctx.rect(e.x-a,e.y-a,2*a,2*a);break;case"triangle":i.fn.vendors.drawShape(i.canvas.ctx,e.x-a,e.y+a/1.66,2*a,3,2);break;case"polygon":i.fn.vendors.drawShape(i.canvas.ctx,e.x-a/(i.particles.shape.polygon.nb_sides/3.5),e.y-a/.76,2.66*a/(i.particles.shape.polygon.nb_sides/3),i.particles.shape.polygon.nb_sides,1);break;case"star":i.fn.vendors.drawShape(i.canvas.ctx,e.x-2*a/(i.particles.shape.polygon.nb_sides/4),e.y-a/1.52,2*a*2.66/(i.particles.shape.polygon.nb_sides/3),i.particles.shape.polygon.nb_sides,2);break;case"image":if("svg"==i.tmp.img_type)var n=e.img.obj;else n=i.tmp.img_obj;n&&i.canvas.ctx.drawImage(n,e.x-a,e.y-a,2*a,2*a/e.img.ratio)}i.canvas.ctx.closePath(),i.particles.shape.stroke.width>0&&(i.canvas.ctx.strokeStyle=i.particles.shape.stroke.color,i.canvas.ctx.lineWidth=i.particles.shape.stroke.width,i.canvas.ctx.stroke()),i.canvas.ctx.fill()},i.fn.particlesCreate=function(){for(var e=0;e=i.particles.opacity.value&&(a.opacity_status=!1),a.opacity+=a.vo):(a.opacity<=i.particles.opacity.anim.opacity_min&&(a.opacity_status=!0),a.opacity-=a.vo),a.opacity<0&&(a.opacity=0)),i.particles.size.anim.enable&&(1==a.size_status?(a.radius>=i.particles.size.value&&(a.size_status=!1),a.radius+=a.vs):(a.radius<=i.particles.size.anim.size_min&&(a.size_status=!0),a.radius-=a.vs),a.radius<0&&(a.radius=0)),"bounce"==i.particles.move.out_mode)var s={x_left:a.radius,x_right:i.canvas.w,y_top:a.radius,y_bottom:i.canvas.h};else s={x_left:-a.radius,x_right:i.canvas.w+a.radius,y_top:-a.radius,y_bottom:i.canvas.h+a.radius};switch(a.x-a.radius>i.canvas.w?(a.x=s.x_left,a.y=Math.random()*i.canvas.h):a.x+a.radius<0&&(a.x=s.x_right,a.y=Math.random()*i.canvas.h),a.y-a.radius>i.canvas.h?(a.y=s.y_top,a.x=Math.random()*i.canvas.w):a.y+a.radius<0&&(a.y=s.y_bottom,a.x=Math.random()*i.canvas.w),i.particles.move.out_mode){case"bounce":(a.x+a.radius>i.canvas.w||a.x-a.radius<0)&&(a.vx=-a.vx),(a.y+a.radius>i.canvas.h||a.y-a.radius<0)&&(a.vy=-a.vy)}if(isInArray("grab",i.interactivity.events.onhover.mode)&&i.fn.modes.grabParticle(a),(isInArray("bubble",i.interactivity.events.onhover.mode)||isInArray("bubble",i.interactivity.events.onclick.mode))&&i.fn.modes.bubbleParticle(a),(isInArray("repulse",i.interactivity.events.onhover.mode)||isInArray("repulse",i.interactivity.events.onclick.mode))&&i.fn.modes.repulseParticle(a),i.particles.line_linked.enable||i.particles.move.attract.enable)for(var n=e+1;n0){var c=i.particles.line_linked.color_rgb_line;i.canvas.ctx.strokeStyle="rgba("+c.r+","+c.g+","+c.b+","+r+")",i.canvas.ctx.lineWidth=i.particles.line_linked.width,i.canvas.ctx.beginPath(),i.canvas.ctx.moveTo(e.x,e.y),i.canvas.ctx.lineTo(a.x,a.y),i.canvas.ctx.stroke(),i.canvas.ctx.closePath()}}},i.fn.interact.attractParticles=function(e,a){var t=e.x-a.x,s=e.y-a.y;if(Math.sqrt(t*t+s*s)<=i.particles.line_linked.distance){var n=t/(1e3*i.particles.move.attract.rotateX),r=s/(1e3*i.particles.move.attract.rotateY);e.vx-=n,e.vy-=r,a.vx+=n,a.vy+=r}},i.fn.interact.bounceParticles=function(e,a){var t=e.x-a.x,i=e.y-a.y;Math.sqrt(t*t+i*i)<=e.radius+a.radius&&(e.vx=-e.vx,e.vy=-e.vy,a.vx=-a.vx,a.vy=-a.vy)},i.fn.modes.pushParticles=function(e,a){i.tmp.pushing=!0;for(var t=0;t=0&&"mousemove"==i.interactivity.status){if(i.interactivity.modes.bubble.size!=i.particles.size.value)if(i.interactivity.modes.bubble.size>i.particles.size.value){(c=e.radius+i.interactivity.modes.bubble.size*s)>=0&&(e.radius_bubble=c)}else{var r=e.radius-i.interactivity.modes.bubble.size,c=e.radius-r*s;e.radius_bubble=c>0?c:0}var o;if(i.interactivity.modes.bubble.opacity!=i.particles.opacity.value)if(i.interactivity.modes.bubble.opacity>i.particles.opacity.value)(o=i.interactivity.modes.bubble.opacity*s)>e.opacity&&o<=i.interactivity.modes.bubble.opacity&&(e.opacity_bubble=o);else(o=e.opacity-(i.particles.opacity.value-i.interactivity.modes.bubble.opacity)*s)=i.interactivity.modes.bubble.opacity&&(e.opacity_bubble=o)}}else n();"mouseleave"==i.interactivity.status&&n()}else if(i.interactivity.events.onclick.enable&&isInArray("bubble",i.interactivity.events.onclick.mode)){if(i.tmp.bubble_clicking){a=e.x-i.interactivity.mouse.click_pos_x,t=e.y-i.interactivity.mouse.click_pos_y;var l=Math.sqrt(a*a+t*t),v=((new Date).getTime()-i.interactivity.mouse.click_time)/1e3;v>i.interactivity.modes.bubble.duration&&(i.tmp.bubble_duration_end=!0),v>2*i.interactivity.modes.bubble.duration&&(i.tmp.bubble_clicking=!1,i.tmp.bubble_duration_end=!1)}function p(a,t,s,n,r){if(a!=t)if(i.tmp.bubble_duration_end)null!=s&&(o=a+(a-(n-v*(n-a)/i.interactivity.modes.bubble.duration)),"size"==r&&(e.radius_bubble=o),"opacity"==r&&(e.opacity_bubble=o));else if(l<=i.interactivity.modes.bubble.distance){if(null!=s)var c=s;else c=n;if(c!=a){var o=n-v*(n-a)/i.interactivity.modes.bubble.duration;"size"==r&&(e.radius_bubble=o),"opacity"==r&&(e.opacity_bubble=o)}}else"size"==r&&(e.radius_bubble=void 0),"opacity"==r&&(e.opacity_bubble=void 0)}i.tmp.bubble_clicking&&(p(i.interactivity.modes.bubble.size,i.particles.size.value,e.radius_bubble,e.radius,"size"),p(i.interactivity.modes.bubble.opacity,i.particles.opacity.value,e.opacity_bubble,e.opacity,"opacity"))}},i.fn.modes.repulseParticle=function(e){if(i.interactivity.events.onhover.enable&&isInArray("repulse",i.interactivity.events.onhover.mode)&&"mousemove"==i.interactivity.status){var a=e.x-i.interactivity.mouse.pos_x,t=e.y-i.interactivity.mouse.pos_y,s=Math.sqrt(a*a+t*t),n={x:a/s,y:t/s},r=clamp(1/(o=i.interactivity.modes.repulse.distance)*(-1*Math.pow(s/o,2)+1)*o*100,0,50),c={x:e.x+n.x*r,y:e.y+n.y*r};"bounce"==i.particles.move.out_mode?(c.x-e.radius>0&&c.x+e.radius0&&c.y+e.radiusi.canvas.w||t.x-e.radius<0)&&(e.vx=-e.vx),(t.y+e.radius>i.canvas.h||t.y-e.radius<0)&&(e.vy=-e.vy)}}()}else 0==i.tmp.repulse_clicking&&(e.vx=e.vx_i,e.vy=e.vy_i)},i.fn.modes.grabParticle=function(e){if(i.interactivity.events.onhover.enable&&"mousemove"==i.interactivity.status){var a=e.x-i.interactivity.mouse.pos_x,t=e.y-i.interactivity.mouse.pos_y,s=Math.sqrt(a*a+t*t);if(s<=i.interactivity.modes.grab.distance){var n=i.interactivity.modes.grab.line_linked.opacity-s/(1/i.interactivity.modes.grab.line_linked.opacity)/i.interactivity.modes.grab.distance;if(n>0){var r=i.particles.line_linked.color_rgb_line;i.canvas.ctx.strokeStyle="rgba("+r.r+","+r.g+","+r.b+","+n+")",i.canvas.ctx.lineWidth=i.particles.line_linked.width,i.canvas.ctx.beginPath(),i.canvas.ctx.moveTo(e.x,e.y),i.canvas.ctx.lineTo(i.interactivity.mouse.pos_x,i.interactivity.mouse.pos_y),i.canvas.ctx.stroke(),i.canvas.ctx.closePath()}}}},i.fn.vendors.eventsListeners=function(){"window"==i.interactivity.detect_on?i.interactivity.el=window:i.interactivity.el=i.canvas.el,(i.interactivity.events.onhover.enable||i.interactivity.events.onclick.enable)&&(i.interactivity.el.addEventListener("mousemove",(function(e){if(i.interactivity.el==window)var a=e.clientX,t=e.clientY;else a=e.offsetX||e.clientX,t=e.offsetY||e.clientY;i.interactivity.mouse.pos_x=a,i.interactivity.mouse.pos_y=t,i.tmp.retina&&(i.interactivity.mouse.pos_x*=i.canvas.pxratio,i.interactivity.mouse.pos_y*=i.canvas.pxratio),i.interactivity.status="mousemove"})),i.interactivity.el.addEventListener("mouseleave",(function(e){i.interactivity.mouse.pos_x=null,i.interactivity.mouse.pos_y=null,i.interactivity.status="mouseleave"}))),i.interactivity.events.onclick.enable&&i.interactivity.el.addEventListener("click",(function(){if(i.interactivity.mouse.click_pos_x=i.interactivity.mouse.pos_x,i.interactivity.mouse.click_pos_y=i.interactivity.mouse.pos_y,i.interactivity.mouse.click_time=(new Date).getTime(),i.interactivity.events.onclick.enable)switch(i.interactivity.events.onclick.mode){case"push":i.particles.move.enable||1==i.interactivity.modes.push.particles_nb?i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb,i.interactivity.mouse):i.interactivity.modes.push.particles_nb>1&&i.fn.modes.pushParticles(i.interactivity.modes.push.particles_nb);break;case"remove":i.fn.modes.removeParticles(i.interactivity.modes.remove.particles_nb);break;case"bubble":i.tmp.bubble_clicking=!0;break;case"repulse":i.tmp.repulse_clicking=!0,i.tmp.repulse_count=0,i.tmp.repulse_finish=!1,setTimeout((function(){i.tmp.repulse_clicking=!1}),1e3*i.interactivity.modes.repulse.duration)}}))},i.fn.vendors.densityAutoParticles=function(){if(i.particles.number.density.enable){var e=i.canvas.el.width*i.canvas.el.height/1e3;i.tmp.retina&&(e/=2*i.canvas.pxratio);var a=e*i.particles.number.value/i.particles.number.density.value_area,t=i.particles.array.length-a;t<0?i.fn.modes.pushParticles(Math.abs(t)):i.fn.modes.removeParticles(t)}},i.fn.vendors.checkOverlap=function(e,a){for(var t=0;t=i.particles.number.value?(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame)):i.tmp.img_error||(i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw)):null!=i.tmp.img_obj?(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame)):i.tmp.img_error||(i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw)):(i.fn.particlesDraw(),i.particles.move.enable?i.fn.drawAnimFrame=requestAnimFrame(i.fn.vendors.draw):cancelRequestAnimFrame(i.fn.drawAnimFrame))},i.fn.vendors.checkBeforeDraw=function(){"image"==i.particles.shape.type?"svg"==i.tmp.img_type&&null==i.tmp.source_svg?i.tmp.checkAnimFrame=requestAnimFrame(check):(cancelRequestAnimFrame(i.tmp.checkAnimFrame),i.tmp.img_error||(i.fn.vendors.init(),i.fn.vendors.draw())):(i.fn.vendors.init(),i.fn.vendors.draw())},i.fn.vendors.init=function(){i.fn.retinaInit(),i.fn.canvasInit(),i.fn.canvasSize(),i.fn.canvasPaint(),i.fn.particlesCreate(),i.fn.vendors.densityAutoParticles(),i.particles.line_linked.color_rgb_line=hexToRgb(i.particles.line_linked.color)},i.fn.vendors.start=function(){isInArray("image",i.particles.shape.type)?(i.tmp.img_type=i.particles.shape.image.src.substr(i.particles.shape.image.src.length-3),i.fn.vendors.loadImg(i.tmp.img_type)):i.fn.vendors.checkBeforeDraw()},i.fn.vendors.eventsListeners(),i.fn.vendors.start()};function hexToRgb(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,a,t,i){return a+a+t+t+i+i}));var a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return a?{r:parseInt(a[1],16),g:parseInt(a[2],16),b:parseInt(a[3],16)}:null}function clamp(e,a,t){return Math.min(Math.max(e,a),t)}function isInArray(e,a){return a.indexOf(e)>-1}Object.deepExtend=function(e,a){for(var t in a)a[t]&&a[t].constructor&&a[t].constructor===Object?(e[t]=e[t]||{},arguments.callee(e[t],a[t])):e[t]=a[t];return e},window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)},window.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout,window.pJSDom=[],window.particlesJS=function(e,a){"string"!=typeof e&&(a=e,e="particles-js"),e||(e="particles-js");var t=document.getElementById(e),i=t.getElementsByClassName("particles-js-canvas-el");if(i.length)for(;i.length>0;)t.removeChild(i[0]);var s=document.createElement("canvas");s.className="particles-js-canvas-el",s.style.width="100%",s.style.height="100%",null!=document.getElementById(e).appendChild(s)&&pJSDom.push(new pJS(e,a))},window.particlesJS.load=function(e,a,t){var i=new XMLHttpRequest;i.open("GET",a),i.onreadystatechange=function(a){if(4==i.readyState)if(200==i.status){var s=JSON.parse(a.currentTarget.response);window.particlesJS(e,s),t&&t()}else console.log("Error pJS - XMLHttpRequest status: "+i.status),console.log("Error pJS - File config not found")},i.send()}; !function(e,n){"use strict";e(window).on("elementor/frontend/init",(function(){var n,t=elementorModules.frontend.handlers.Base;n=t.extend({bindEvents:function(){this.run()},getDefaultSettings:function(){return{allowHTML:!0}},onElementChange:debounce((function(e){-1!==e.indexOf("section_particles")&&this.run()}),400),settings:function(e){return this.getElementSettings("section_particles_"+e)},run:function(){var n="bdt-particle-container-"+this.$element.data("id"),t=this.$element.data("id"),i=e(".elementor-element-"+t);this.particleID=n;var o={particles:{number:{value:80,density:{enable:!0,value_area:800}},color:{value:"#ffffff"},shape:{type:"circle",stroke:{width:0,color:"#000000"},polygon:{nb_sides:5},image:{src:"",width:100,height:100}},opacity:{value:.5,random:!1,anim:{enable:!1,speed:1,opacity_min:.1,sync:!1}},size:{value:3,random:!0,anim:{enable:!1,speed:40,size_min:.1,sync:!1}},line_linked:{enable:!0,distance:150,color:"#ffffff",opacity:.4,width:1},move:{enable:!0,speed:6,direction:"none",random:!1,straight:!1,out_mode:"out",bounce:!1,attract:{enable:!1,rotateX:600,rotateY:1200}}},interactivity:{detect_on:"canvas",events:{onhover:{enable:!1,mode:"repulse"},onclick:{enable:!0,mode:"push"},resize:!0},modes:{grab:{distance:400,line_linked:{opacity:1}},bubble:{distance:400,size:40,duration:2,opacity:8,speed:3},repulse:{distance:200,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}}},retina_detect:!0};this.settings("js")&&0!==this.settings("js").length&&(o=JSON.parse(this.settings("js"))),this.settings("on")&&(0===e("#"+n).length&&e(i).prepend('
'),particlesJS(n,o))}}),elementorFrontend.hooks.addAction("frontend/element_ready/section",(function(e){elementorFrontend.elementsHandler.addHandler(n,{$element:e})})),elementorFrontend.hooks.addAction("frontend/element_ready/container",(function(e){elementorFrontend.elementsHandler.addHandler(n,{$element:e})}))}))}(jQuery,window.elementorFrontend); (function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Typed=e():t.Typed=e()})(this,function(){return function(t){function e(n){if(s[n])return s[n].exports;var i=s[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var s={};return e.m=t,e.c=s,e.p="",e(0)}([function(t,e,s){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var s=0;st.length)););var u=t.substring(0,e),l=t.substring(u.length+1,e+i),c=t.substring(e+i+1);t=u+l+c,i--}s.timeout=setTimeout(function(){s.toggleBlinking(!1),e>=t.length?s.doneTyping(t,e):s.keepTyping(t,e,i),s.temporaryPause&&(s.temporaryPause=!1,s.options.onTypingResumed(s.arrayPos,s))},n)},n))}},{key:"keepTyping",value:function(t,e,s){0===e&&(this.toggleBlinking(!1),this.options.preStringTyped(this.arrayPos,this)),e+=s;var n=t.substr(0,e);this.replaceText(n),this.typewrite(t,e)}},{key:"doneTyping",value:function(t,e){var s=this;this.options.onStringTyped(this.arrayPos,this),this.toggleBlinking(!0),this.arrayPos===this.strings.length-1&&(this.complete(),this.loop===!1||this.curLoop===this.loopCount)||(this.timeout=setTimeout(function(){s.backspace(t,e)},this.backDelay))}},{key:"backspace",value:function(t,e){var s=this;if(this.pause.status===!0)return void this.setPauseStatus(t,e,!1);if(this.fadeOut)return this.initFadeOut();this.toggleBlinking(!1);var n=this.humanizer(this.backSpeed);this.timeout=setTimeout(function(){e=o.htmlParser.backSpaceHtmlChars(t,e,s);var n=t.substr(0,e);if(s.replaceText(n),s.smartBackspace){var i=s.strings[s.arrayPos+1];i&&n===i.substr(0,e)?s.stopNum=e:s.stopNum=0}e>s.stopNum?(e--,s.backspace(t,e)):e<=s.stopNum&&(s.arrayPos++,s.arrayPos===s.strings.length?(s.arrayPos=0,s.options.onLastStringBackspaced(),s.shuffleStringsIfNeeded(),s.begin()):s.typewrite(s.strings[s.sequence[s.arrayPos]],e))},n)}},{key:"complete",value:function(){this.options.onComplete(this),this.loop?this.curLoop++:this.typingComplete=!0}},{key:"setPauseStatus",value:function(t,e,s){this.pause.typewrite=s,this.pause.curString=t,this.pause.curStrPos=e}},{key:"toggleBlinking",value:function(t){this.cursor&&(this.pause.status||this.cursorBlinking!==t&&(this.cursorBlinking=t,t?this.cursor.classList.add("typed-cursor--blink"):this.cursor.classList.remove("typed-cursor--blink")))}},{key:"humanizer",value:function(t){return Math.round(Math.random()*t/2)+t}},{key:"shuffleStringsIfNeeded",value:function(){this.shuffle&&(this.sequence=this.sequence.sort(function(){return Math.random()-.5}))}},{key:"initFadeOut",value:function(){var t=this;return this.el.className+=" "+this.fadeOutClass,this.cursor&&(this.cursor.className+=" "+this.fadeOutClass),setTimeout(function(){t.arrayPos++,t.replaceText(""),t.strings.length>t.arrayPos?t.typewrite(t.strings[t.sequence[t.arrayPos]],0):(t.typewrite(t.strings[0],0),t.arrayPos=0)},this.fadeOutDelay)}},{key:"replaceText",value:function(t){this.attr?this.el.setAttribute(this.attr,t):this.isInput?this.el.value=t:"html"===this.contentType?this.el.innerHTML=t:this.el.textContent=t}},{key:"bindFocusEvents",value:function(){var t=this;this.isInput&&(this.el.addEventListener("focus",function(e){t.stop()}),this.el.addEventListener("blur",function(e){t.el.value&&0!==t.el.value.length||t.start()}))}},{key:"insertCursor",value:function(){this.showCursor&&(this.cursor||(this.cursor=document.createElement("span"),this.cursor.className="typed-cursor",this.cursor.setAttribute("aria-hidden",!0),this.cursor.innerHTML=this.cursorChar,this.el.parentNode&&this.el.parentNode.insertBefore(this.cursor,this.el.nextSibling)))}}]),t}();e["default"]=a,t.exports=e["default"]},function(t,e,s){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e":";";t.substr(e+1).charAt(0)!==i&&(e++,!(e+1>t.length)););e++}return e}},{key:"backSpaceHtmlChars",value:function(t,e,s){if("html"!==s.contentType)return e;var n=t.substr(e).charAt(0);if(">"===n||";"===n){var i="";for(i=">"===n?"<":"&";t.substr(e-1).charAt(0)!==i&&(e--,!(e<0)););e--}return e}}]),t}();e["default"]=i;var r=new i;e.htmlParser=r}])}); !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(u){"use strict";u.ui=u.ui||{},u.ui.version="1.13.1";var a=u,n={},e=n.toString,f=/^([\-+])=\s*(\d+\.?\d*)/,t=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),t[4]?(parseInt(t[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),t[4]?(parseInt(t[4]+t[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=a.Color=function(t,e,n,r){return new a.Color.fn.parse(t,e,n,r)},d={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},p={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},s=l.support={},r=a("

")[0],h=a.each; function g(t){return null==t?t+"":"object"==typeof t?n[e.call(t)]||"object":typeof t}function m(t,e,n){var r=p[e.type]||{};return null==t?n||!e.def?null:e.def:(t=r.floor?~~t:parseFloat(t),isNaN(t)?e.def:r.mod?(t+r.mod)%r.mod:Math.min(r.max,Math.max(0,t)))}function c(r){var o=l(),i=o._rgba=[];return r=r.toLowerCase(),h(t,function(t,e){var n=e.re.exec(r),n=n&&e.parse(n),e=e.space||"rgba";if(n)return n=o[e](n),o[d[e].cache]=n[d[e].cache],i=o._rgba=n._rgba,!1}),i.length?("0,0,0,0"===i.join()&&a.extend(i,M.transparent),o):M[r]}function o(t,e,n){return 6*(n=(n+1)%1)<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}r.style.cssText="background-color:rgba(1,1,1,.5)",s.rgba=-1i.mod/2?r+=i.mod:r-o>i.mod/2&&(r-=i.mod)),c[n]=m((o-r)*s+r,e)))}),this[t](c)},blend:function(t){var e,n,r;return 1===this._rgba[3]?this:(e=this._rgba.slice(),n=e.pop(),r=l(t)._rgba,l(a.map(e,function(t,e){return(1-n)*r[e]+n*t})))},toRgbaString:function(){var t="rgba(",e=a.map(this._rgba,function(t,e){return null!=t?t:2

").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:n.width(),height:n.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return n.wrap(t),n[0]!==o&&!u.contains(n[0],o)||u(o).trigger("focus"),t=n.parent(),"static"===n.css("position")?(t.css({position:"relative"}),n.css({position:"relative"})):(u.extend(r,{position:n.css("position"),zIndex:n.css("z-index")}),u.each(["top","left","bottom","right"],function(t,e){r[e]=n.css(e),isNaN(parseInt(r[e],10))&&(r[e]="auto")}),n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),n.css(e),t.css(r).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!u.contains(t[0],e)||u(e).trigger("focus")),t}}),u.extend(u.effects,{version:"1.13.2",define:function(t,e,n){return n||(n=e,e="effect"),u.effects.effect[t]=n,u.effects.effect[t].mode=e,n},scaledDimensions:function(t,e,n){var r;return 0===e?{height:0,width:0,outerHeight:0,outerWidth:0}:(r="horizontal"!==n?(e||100)/100:1,n="vertical"!==n?(e||100)/100:1,{height:t.height()*n,width:t.width()*r,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*r})},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,n){var r=t.queue();1").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(j+"placeholder",e)),t.css({position:n,left:r.left,top:r.top}),e},removePlaceholder:function(t){var e=j+"placeholder",n=t.data(e);n&&(n.remove(),t.removeData(e))},cleanUp:function(t){u.effects.restoreStyle(t),u.effects.removePlaceholder(t)},setTransition:function(r,t,o,i){return i=i||{},u.each(t,function(t,e){var n=r.cssUnit(e);0");c.appendTo("body").addClass(t.className).css({top:r.top-s,left:r.left-i,height:n.innerHeight(),width:n.innerWidth(),position:o?"fixed":"absolute"}).animate(a,t.duration,t.easing,function(){c.remove(),"function"==typeof e&&e()})}}),u.fx.step.clip=function(t){t.clipInit||(t.start=u(t.elem).cssClip(),"string"==typeof t.end&&(t.end=R(t.end,t.elem)),t.clipInit=!0),u(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},S={},u.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){S[t]=function(t){return Math.pow(t,e+2)}}),u.extend(S,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}}),u.each(S,function(t,e){u.easing["easeIn"+t]=e,u.easing["easeOut"+t]=function(t){return 1-e(1-t)},u.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}}),u.effects}); (function(fn){ if(typeof define==='function'&&define.amd){ define([], fn); }else if((typeof module!=="undefined"&&module!==null)&&module.exports){ module.exports=fn; }else{ fn(); }})(function(){ var assign=Object.assign||window.jQuery&&jQuery.extend; var threshold=8; var requestFrame=(function(){ return ( window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(fn, element){ return window.setTimeout(function(){ fn(); }, 25); } ); })(); (function (){ if(typeof window.CustomEvent==="function") return false; function CustomEvent(event, params){ params=params||{ bubbles: false, cancelable: false, detail: undefined }; var evt=document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype=window.Event.prototype; window.CustomEvent=CustomEvent; })(); var ignoreTags={ textarea: true, input: true, select: true, button: true }; var mouseevents={ move: 'mousemove', cancel: 'mouseup dragstart', end: 'mouseup' }; var touchevents={ move: 'touchmove', cancel: 'touchend', end: 'touchend' }; var rspaces=/\s+/; var eventOptions={ bubbles: true, cancelable: true }; var eventsSymbol=typeof Symbol==="function" ? Symbol('events'):{}; function createEvent(type){ return new CustomEvent(type, eventOptions); } function getEvents(node){ return node[eventsSymbol]||(node[eventsSymbol]={}); } function on(node, types, fn, data, selector){ types=types.split(rspaces); var events=getEvents(node); var i=types.length; var handlers, type; function handler(e){ fn(e, data); } while (i--){ type=types[i]; handlers=events[type]||(events[type]=[]); handlers.push([fn, handler]); node.addEventListener(type, handler); }} function off(node, types, fn, selector){ types=types.split(rspaces); var events=getEvents(node); var i=types.length; var type, handlers, k; if(!events){ return; } while (i--){ type=types[i]; handlers=events[type]; if(!handlers){ continue; } k=handlers.length; while (k--){ if(handlers[k][0]===fn){ node.removeEventListener(type, handlers[k][1]); handlers.splice(k, 1); }} }} function trigger(node, type, properties){ var event=createEvent(type); if(properties){ assign(event, properties); } node.dispatchEvent(event); } function Timer(fn){ var callback=fn, active=false, running=false; function trigger(time){ if(active){ callback(); requestFrame(trigger); running=true; active=false; }else{ running=false; }} this.kick=function(fn){ active=true; if(!running){ trigger(); }}; this.end=function(fn){ var cb=callback; if(!fn){ return; } if(!running){ fn(); }else{ callback=active ? function(){ cb(); fn(); } : fn ; active=true; }};} function noop(){} function preventDefault(e){ e.preventDefault(); } function isIgnoreTag(e){ return !!ignoreTags[e.target.tagName.toLowerCase()]; } function isPrimaryButton(e){ return (e.which===1&&!e.ctrlKey&&!e.altKey); } function identifiedTouch(touchList, id){ var i, l; if(touchList.identifiedTouch){ return touchList.identifiedTouch(id); } i=-1; l=touchList.length; while (++i < l){ if(touchList[i].identifier===id){ return touchList[i]; }} } function changedTouch(e, data){ var touch=identifiedTouch(e.changedTouches, data.identifier); if(!touch){ return; } if(touch.pageX===data.pageX&&touch.pageY===data.pageY){ return; } return touch; } function mousedown(e){ if(!isPrimaryButton(e)){ return; } if(isIgnoreTag(e)){ return; } on(document, mouseevents.move, mousemove, e); on(document, mouseevents.cancel, mouseend, e); } function mousemove(e, data){ checkThreshold(e, data, e, removeMouse); } function mouseend(e, data){ removeMouse(); } function removeMouse(){ off(document, mouseevents.move, mousemove); off(document, mouseevents.cancel, mouseend); } function touchstart(e){ if(ignoreTags[e.target.tagName.toLowerCase()]){ return; } var touch=e.changedTouches[0]; var data={ target: touch.target, pageX: touch.pageX, pageY: touch.pageY, identifier: touch.identifier, touchmove: function(e, data){ touchmove(e, data); }, touchend: function(e, data){ touchend(e, data); }}; on(document, touchevents.move, data.touchmove, data); on(document, touchevents.cancel, data.touchend, data); } function touchmove(e, data){ var touch=changedTouch(e, data); if(!touch){ return; } checkThreshold(e, data, touch, removeTouch); } function touchend(e, data){ var touch=identifiedTouch(e.changedTouches, data.identifier); if(!touch){ return; } removeTouch(data); } function removeTouch(data){ off(document, touchevents.move, data.touchmove); off(document, touchevents.cancel, data.touchend); } function checkThreshold(e, data, touch, fn){ var distX=touch.pageX - data.pageX; var distY=touch.pageY - data.pageY; if((distX * distX) + (distY * distY) < (threshold * threshold)){ return; } triggerStart(e, data, touch, distX, distY, fn); } function triggerStart(e, data, touch, distX, distY, fn){ var touches=e.targetTouches; var time=e.timeStamp - data.timeStamp; var template={ altKey: e.altKey, ctrlKey: e.ctrlKey, shiftKey: e.shiftKey, startX: data.pageX, startY: data.pageY, distX: distX, distY: distY, deltaX: distX, deltaY: distY, pageX: touch.pageX, pageY: touch.pageY, velocityX: distX / time, velocityY: distY / time, identifier: data.identifier, targetTouches: touches, finger: touches ? touches.length:1, enableMove: function(){ this.moveEnabled=true; this.enableMove=noop; e.preventDefault(); }}; trigger(data.target, 'movestart', template); fn(data); } function activeMousemove(e, data){ var timer=data.timer; data.touch=e; data.timeStamp=e.timeStamp; timer.kick(); } function activeMouseend(e, data){ var target=data.target; var event=data.event; var timer=data.timer; removeActiveMouse(); endEvent(target, event, timer, function(){ setTimeout(function(){ off(target, 'click', preventDefault); }, 0); }); } function removeActiveMouse(){ off(document, mouseevents.move, activeMousemove); off(document, mouseevents.end, activeMouseend); } function activeTouchmove(e, data){ var event=data.event; var timer=data.timer; var touch=changedTouch(e, event); if(!touch){ return; } e.preventDefault(); event.targetTouches=e.targetTouches; data.touch=touch; data.timeStamp=e.timeStamp; timer.kick(); } function activeTouchend(e, data){ var target=data.target; var event=data.event; var timer=data.timer; var touch=identifiedTouch(e.changedTouches, event.identifier); if(!touch){ return; } removeActiveTouch(data); endEvent(target, event, timer); } function removeActiveTouch(data){ off(document, touchevents.move, data.activeTouchmove); off(document, touchevents.end, data.activeTouchend); } function updateEvent(event, touch, timeStamp){ var time=timeStamp - event.timeStamp; event.distX=touch.pageX - event.startX; event.distY=touch.pageY - event.startY; event.deltaX=touch.pageX - event.pageX; event.deltaY=touch.pageY - event.pageY; event.velocityX=0.3 * event.velocityX + 0.7 * event.deltaX / time; event.velocityY=0.3 * event.velocityY + 0.7 * event.deltaY / time; event.pageX=touch.pageX; event.pageY=touch.pageY; } function endEvent(target, event, timer, fn){ timer.end(function(){ trigger(target, 'moveend', event); return fn&&fn(); }); } function movestart(e){ if(e.defaultPrevented){ return; } if(!e.moveEnabled){ return; } var event={ startX: e.startX, startY: e.startY, pageX: e.pageX, pageY: e.pageY, distX: e.distX, distY: e.distY, deltaX: e.deltaX, deltaY: e.deltaY, velocityX: e.velocityX, velocityY: e.velocityY, identifier: e.identifier, targetTouches: e.targetTouches, finger: e.finger }; var data={ target: e.target, event: event, timer: new Timer(update), touch: undefined, timeStamp: e.timeStamp }; function update(time){ updateEvent(event, data.touch, data.timeStamp); trigger(data.target, 'move', event); } if(e.identifier===undefined){ on(e.target, 'click', preventDefault); on(document, mouseevents.move, activeMousemove, data); on(document, mouseevents.end, activeMouseend, data); }else{ data.activeTouchmove=function(e, data){ activeTouchmove(e, data); }; data.activeTouchend=function(e, data){ activeTouchend(e, data); }; on(document, touchevents.move, data.activeTouchmove, data); on(document, touchevents.end, data.activeTouchend, data); }} on(document, 'mousedown', mousedown); on(document, 'touchstart', touchstart); on(document, 'movestart', movestart); if(!window.jQuery){ return; } var properties=("startX startY pageX pageY distX distY deltaX deltaY velocityX velocityY").split(' '); function enableMove1(e){ e.enableMove(); } function enableMove2(e){ e.enableMove(); } function enableMove3(e){ e.enableMove(); } function add(handleObj){ var handler=handleObj.handler; handleObj.handler=function(e){ var i=properties.length; var property; while(i--){ property=properties[i]; e[property]=e.originalEvent[property]; } handler.apply(this, arguments); };} jQuery.event.special.movestart={ setup: function(){ on(this, 'movestart', enableMove1); return false; }, teardown: function(){ off(this, 'movestart', enableMove1); return false; }, add: add }; jQuery.event.special.move={ setup: function(){ on(this, 'movestart', enableMove2); return false; }, teardown: function(){ off(this, 'movestart', enableMove2); return false; }, add: add }; jQuery.event.special.moveend={ setup: function(){ on(this, 'movestart', enableMove3); return false; }, teardown: function(){ off(this, 'movestart', enableMove3); return false; }, add: add };}); !function(C){C.fn.twentytwenty=function(g){return g=C.extend({default_offset_pct:.5,orientation:"horizontal",switch_before_label:!0,before_label:"Before",switch_after_label:!0,after_label:"After",no_overlay:!1,move_slider_on_hover:!1,move_with_handle_only:!0,click_to_move:!1,show_drag:!0,show_sep:!0,horbeforePos:"middle",horafterPos:"middle",verbeforePos:"center",verafterPos:"center"},g),this.each(function(){var t=g.default_offset_pct,m=C(this),w=g.orientation,e="vertical"===w?"down":"left",n="vertical"===w?"up":"right";g.no_overlay?m.append("
"):m.append("
");var f=m.find("img:first"),v=m.find("img:last");g.show_sep?m.append("
"):m.append("
");var h=m.find(".premium-twentytwenty-handle");h.append(""),h.append(""),m.addClass("premium-twentytwenty-container"),f.addClass("premium-twentytwenty-before"),v.addClass("premium-twentytwenty-after"),g.show_drag||h.css("opacity","0");var a=m.find(".premium-twentytwenty-overlay");if(g.switch_before_label){var i="
"+g.before_label+"
";a.append(i)}if(g.switch_after_label){var s="
"+g.after_label+"
";a.append(s)}function r(e){var t,n,a,i,s=(t=e,{w:(n=f.width())+"px",h:(a=f.height())+"px",cw:t*n+"px",ch:t*a+"px"}),r=C(m).find(".premium-twentytwenty-before-label"),o=C(m).find(".premium-twentytwenty-after-label");if(h.css("vertical"===w?"top":"left","vertical"===w?s.ch:s.cw),"horizontal"===w){var l=void 0!==r.css("left")?parseInt(r.css("left").replace(/px/,"")):"",d=parseInt(r.outerWidth()),p=void 0!==o.css("left")?parseInt(o.css("left").replace(/px/,"")):"";(c=parseInt(h.css("left").replace(/px/,"")))e.distY&&e.distX<-e.distY||e.distX-e.distY)&&"vertical"!==w||(e.distXe.distY&&e.distX>-e.distY)&&"vertical"===w)&&e.preventDefault(),m.addClass("active"),c=m.offset().left,u=m.offset().top,y=f.width(),_=f.height()}function d(e){m.hasClass("active")&&(t=o(e.pageX,e.pageY),r(t))}function p(){m.removeClass("active")}var c=0,u=0,y=0,_=0,b=g.move_with_handle_only?h:m;b.on("movestart",l),b.on("move",d),b.on("moveend",p),g.move_slider_on_hover&&(m.on("mouseenter",l),m.on("mousemove",d),m.on("mouseleave",p)),h.on("touchmove",function(e){e.preventDefault()}),m.find("img").on("mousedown",function(e){e.preventDefault()}),g.click_to_move&&m.on("click",function(e){c=m.offset().left,u=m.offset().top,y=f.width(),_=f.height(),t=o(e.pageX,e.pageY),r(t)}),C(window).trigger("resize.twentytwenty")})}}(jQuery); !function(t,e){"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,(function(){function t(){}let e=t.prototype;return e.on=function(t,e){if(!t||!e)return this;let i=this._events=this._events||{},s=i[t]=i[t]||[];return s.includes(e)||s.push(e),this},e.once=function(t,e){if(!t||!e)return this;this.on(t,e);let i=this._onceEvents=this._onceEvents||{};return(i[t]=i[t]||{})[e]=!0,this},e.off=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;let s=i.indexOf(e);return-1!=s&&i.splice(s,1),this},e.emitEvent=function(t,e){let i=this._events&&this._events[t];if(!i||!i.length)return this;i=i.slice(0),e=e||[];let s=this._onceEvents&&this._onceEvents[t];for(let n of i){s&&s[n]&&(this.off(t,n),delete s[n]),n.apply(this,e)}return this},e.allOff=function(){return delete this._events,delete this._onceEvents,this},t})), function(t,e){"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(t,e){let i=t.jQuery,s=t.console;function n(t,e,o){if(!(this instanceof n))return new n(t,e,o);let r=t;var h;("string"==typeof t&&(r=document.querySelectorAll(t)),r)?(this.elements=(h=r,Array.isArray(h)?h:"object"==typeof h&&"number"==typeof h.length?[...h]:[h]),this.options={},"function"==typeof e?o=e:Object.assign(this.options,e),o&&this.on("always",o),this.getImages(),i&&(this.jqDeferred=new i.Deferred),setTimeout(this.check.bind(this))):s.error(`Bad element for imagesLoaded ${r||t}`)}n.prototype=Object.create(e.prototype),n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const o=[1,9,11];n.prototype.addElementImages=function(t){"IMG"===t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);let{nodeType:e}=t;if(!e||!o.includes(e))return;let i=t.querySelectorAll("img");for(let t of i)this.addImage(t);if("string"==typeof this.options.background){let e=t.querySelectorAll(this.options.background);for(let t of e)this.addElementBackgroundImages(t)}};const r=/url\((['"])?(.*?)\1\)/gi;function h(t){this.img=t}function d(t,e){this.url=t,this.element=e,this.img=new Image}return n.prototype.addElementBackgroundImages=function(t){let e=getComputedStyle(t);if(!e)return;let i=r.exec(e.backgroundImage);for(;null!==i;){let s=i&&i[2];s&&this.addBackground(s,t),i=r.exec(e.backgroundImage)}},n.prototype.addImage=function(t){let e=new h(t);this.images.push(e)},n.prototype.addBackground=function(t,e){let i=new d(t,e);this.images.push(i)},n.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let t=(t,e,i)=>{setTimeout((()=>{this.progress(t,e,i)}))};this.images.forEach((function(e){e.once("progress",t),e.check()}))},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&s&&s.log(`progress: ${i}`,t,e)},n.prototype.complete=function(){let t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){let t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},h.prototype=Object.create(e.prototype),h.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},h.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},h.prototype.confirm=function(t,e){this.isLoaded=t;let{parentNode:i}=this.img,s="PICTURE"===i.nodeName?i:this.img;this.emitEvent("progress",[this,s,e])},h.prototype.handleEvent=function(t){let e="on"+t.type;this[e]&&this[e](t)},h.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},h.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},h.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype=Object.create(h.prototype),d.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},d.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},d.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){(e=e||t.jQuery)&&(i=e,i.fn.imagesLoaded=function(t,e){return new n(this,t,e).jqDeferred.promise(i(this))})},n.makeJQueryPlugin(),n})); (function (factory){ if(typeof define==='function'&&define.amd){ define(['jquery'], factory); }else if(typeof exports==='object'){ factory(require('jquery')); }else{ factory(jQuery); }}(function ($){ var CountTo=function (element, options){ this.$element=$(element); this.options=$.extend({}, CountTo.DEFAULTS, this.dataOptions(), options); this.init(); }; CountTo.DEFAULTS={ from: 0, to: 0, speed: 1000, refreshInterval: 100, decimals: 0, formatter: formatter, onUpdate: null, onComplete: null }; CountTo.prototype.init=function (){ this.value=this.options.from; this.loops=Math.ceil(this.options.speed / this.options.refreshInterval); this.loopCount=0; this.increment=(this.options.to - this.options.from) / this.loops; }; CountTo.prototype.dataOptions=function (){ var options={ from: this.$element.data('from'), to: this.$element.data('to'), speed: this.$element.data('speed'), refreshInterval: this.$element.data('refresh-interval'), decimals: this.$element.data('decimals') }; var keys=Object.keys(options); for (var i in keys){ var key=keys[i]; if(typeof(options[key])==='undefined'){ delete options[key]; }} return options; }; CountTo.prototype.update=function (){ this.value +=this.increment; this.loopCount++; this.render(); if(typeof(this.options.onUpdate)=='function'){ this.options.onUpdate.call(this.$element, this.value); } if(this.loopCount >=this.loops){ clearInterval(this.interval); this.value=this.options.to; if(typeof(this.options.onComplete)=='function'){ this.options.onComplete.call(this.$element, this.value); }} }; CountTo.prototype.render=function (){ var formattedValue=this.options.formatter.call(this.$element, this.value, this.options); this.$element.text(formattedValue); }; CountTo.prototype.restart=function (){ this.stop(); this.init(); this.start(); }; CountTo.prototype.start=function (){ this.stop(); this.render(); this.interval=setInterval(this.update.bind(this), this.options.refreshInterval); }; CountTo.prototype.stop=function (){ if(this.interval){ clearInterval(this.interval); }}; CountTo.prototype.toggle=function (){ if(this.interval){ this.stop(); }else{ this.start(); }}; function formatter(value, options){ return value.toFixed(options.decimals); } $.fn.countTo=function (option){ return this.each(function (){ var $this=$(this); var data=$this.data('countTo'); var init = !data||typeof(option)==='object'; var options=typeof(option)==='object' ? option:{}; var method=typeof(option)==='string' ? option:'start'; if(init){ if(data) data.stop(); $this.data('countTo', data=new CountTo(this, options)); } data[method].call(data); }); };})); (function ($){ const wdtCounterWidgetHandler=function($scope, $){ $scope.find('.wdt-content-counter-number').countTo({ decimals: 2, formatter: function (value, options){ let toValue=jQuery(this).data('to'); if(Number.isInteger(toValue)){ return value.toFixed(0); }else{ return value.toFixed(options.decimals); }} }); }; $(window).on('elementor/frontend/init', function (){ elementorFrontend.hooks.addAction('frontend/element_ready/wdt-counter.default', wdtCounterWidgetHandler); }); })(jQuery); !function(){"use strict";window._R_is_Editor?RVS._R=void 0===RVS._R?{}:RVS._R:window._R_is_Editor=!1,jQuery.fn.revolution=jQuery.fn.revolution||{};var t,e,i,n,r,s,a,o,l=window._R_is_Editor?RVS._R:jQuery.fn.revolution;function u(t,e,i,n,r,s,a){var o=t/e;isNaN(o)||0===o||!isFinite(o)?(t=i,e=i):o>=1?e=(t=i)/o:t=(e=i)*o,a?(n.crossOrigin="Anonymous",n.addEventListener("load",(function(){c(t,e,n,r,s)})),n.src=a):c(t,e,n,r,s)}function c(t,e,i,n,r){var s=Math.max(t,e);s+=4,i.width=t,i.height=e,n.canvas.width=s,n.canvas.height=s,n.webkitImageSmoothingEnabled=!1,n.msImageSmoothingEnabled=!1,n.imageSmoothingEnabled=!1,n.scale(1,-1),n.drawImage(i,(s-t)/2+2,-(s-e)/2+2,t-4,-e-4),r(n.canvas)}function m(t,l){if(this.settings=t,l&&l.theCluster){this.count=t.amount*t.amount;var u=this.w=t.width,c=this.h=t.height;this.camera=new THREE.PerspectiveCamera(70,u/c,1,1e3),this.scene=new THREE.Scene,this.group=new THREE.Group,this.particleMaterial,this.posToUniform,this.vccToUniform,this.camera.position.z=20,e="\n\t\t\tuniform float u_speed;\n\t\t\tuniform float u_time;\n\t\t\tuniform float u_lifeTimeDelay;\n\n\t\t\tvoid main(){\n\t\t\t\tvec2 uv=gl_FragCoord.xy / resolution.xy;\n\t\t\t\tvec4 texturePos=texture2D(texturePosition, uv);\n\t\t\t\tvec4 textureVel=texture2D(textureVelocity, uv);\n\t\t\t\tvec4 textureInitPos=texture2D(textureInitPos, uv);\n\t\t\t\tvec4 textureInitVCC=texture2D(textureInitVCC, uv);\n\t\t\t\tvec3 pos=texturePos.xyz;\n\t\t\t\tvec3 vel=textureVel.xyz;\n\n\t\t\t\tfloat minCo=0.0;\n\t\t\t\tfloat maxCo=0.75;\n\n\t\t\t\t//-- Add ParticleMove Here --\n\n\t\t\t\tgl_FragColor=vec4(pos, 1.0);\n\t\t\t}\n\t\t",n="\n\t\t\tvoid main(){\n\t\t\t\tvec2 uv=gl_FragCoord.xy / resolution.xy;\n\t\t\t\tvec4 textureCV=texture2D(textureCustomValues, uv);\n\n\t\t\t\tgl_FragColor=textureCV;\n\t\t\t}\n\t\t",i="\n\t\t\tvoid main(){\n\t\t\t\tvec2 uv=gl_FragCoord.xy / resolution.xy;\n\t\t\t\tvec4 textureCV=texture2D(textureInitPos, uv);\n\n\t\t\t\tgl_FragColor=textureCV;\n\t\t\t}\n\t\t",r="\n\t\t\tvoid main(){\n\t\t\t\tvec2 uv=gl_FragCoord.xy / resolution.xy;\n\t\t\t\tvec4 textureCV=texture2D(textureInitVCC, uv);\n\n\t\t\t\tgl_FragColor=textureCV;\n\t\t\t}\n\t\t",s="\n\t\t\tuniform float u_speed;\n\t\t\tuniform float u_mass;\n\t\t\tuniform float u_mass2;\n\t\t\tuniform float u_mass3;\n\t\t\tuniform float u_gravPositions[9];\n\t\t\tuniform float u_time;\n\t\t\tuniform float u_lifeTimeDelay;\n\t\t\tuniform float u_noiseAmount;\n\t\t\tuniform vec2 u_mouseVector;\n\t\t\tuniform bool u_mouseOnLayer;\n\n\t\t\t//-- Add Noise Methods Here --\n\n\t\t\tvoid main(){\n\t\t\t\tvec2 uv=gl_FragCoord.xy / resolution.xy;\n\t\t\t\tvec4 texturePos=texture2D(texturePosition, uv);\n\t\t\t\tvec4 textureVel=texture2D(textureVelocity, uv);\n\t\t\t\tvec4 textureCV=texture2D(textureCustomValues, uv);\n\t\t\t\tvec4 textureInitVCC=texture2D(textureInitVCC, uv);\n\t\t\t\tvec3 vel=textureVel.xyz;\n\t\t\t\tvec3 pos=texturePos.xyz;\n\t\t\t\tfloat lifetime=textureVel.w;\n\n\t\t\t\tfloat gravCo=-0.004;\n\t\t\t\tfloat speedCo=0.1;\n\n\t\t\t\tvec3 sumVector=vec3(0.0, 0.0, 0.0);\n\n\t\t\t\t//-- Add G1 Here --\n\t\t\t\t//-- Add G2 Here --\n\t\t\t\t//-- Add G3 Here --\n\t\t\t\t//-- Add G4 Here --\n\n\t\t\t\t//-- Add Modified Vel Here --\n\n\t\t\t\tvel +=sumVector * u_speed * speedCo;\n\n\t\t\t\t//-- Add Noise Here --\n\n\t\t\t\t//-- Add Disolve Here --\n\n\t\t\t\tgl_FragColor=vec4(vel, lifetime);\n\t\t\t}\n\t\t",a="\n\t\t\t//interresting effect with limit on gl_Position.xyz\n\n\t\t\tvec3 limit(inout vec3 pos, vec3 shiftby, float dis){\n\t\t\t\tfloat length=length(pos - shiftby);\n\t\t\t\tif(length > dis){\n\t\t\t\t\treturn (normalize(pos) * dis) + shiftby;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\treturn pos;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvec3 unLimit(inout vec3 pos, vec3 shiftby, float dis){\n\t\t\t\tfloat length=length(pos - shiftby);\n\t\t\t\tif(length < dis){\n\t\t\t\t\treturn (normalize(pos) * dis) + shiftby;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\treturn pos;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tuniform sampler2D texturePosition;\n\t\t\tuniform sampler2D textureVelocity;\n\t\t\tuniform sampler2D textureCustomValues;\n\n\t\t\tuniform float u_pointSize;\n\t\t\tuniform vec3 u_limitCentrePosition;\n\t\t\tuniform float u_limitMovementValue;\n\t\t\tuniform bool u_limitMovement;\n\t\t\tuniform float u_time;\n\t\t\tuniform float u_lifeTimeDelay;\n\n\t\t\tvarying vec3 v_pos;\n\t\t\tvarying float v_lifetime;\n\t\t\tvarying vec2 v_uv;\n\n\t\t\tuniform bool u_mouseOnLayer;\n\t\t\tuniform vec2 u_mouseVector;\n\n\t\t\tvoid main(){\n\t\t\t\tvec4 pos=texture2D(texturePosition, uv);\n\t\t\t\tvec4 vel=texture2D(textureVelocity, uv);\n\t\t\t\tvec4 textureCV=texture2D(textureCustomValues, uv);\n\n\t\t\t\tv_uv=uv;\n\n\t\t\t\tvec4 worldPosition;\n\n\t\t\t\tvec4 endPos;\n\t\t\t\tvec3 posnew=vec3(0.0);\n\n\t\t\t\tif(u_mouseOnLayer==true){\n\t\t\t\t\tposnew=unLimit(pos.xyz, vec3(u_mouseVector, 0.0), 0.55);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tposnew=unLimit(pos.xyz, u_limitCentrePosition, 0.55);\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\tif(u_limitMovement==true){\n\t\t\t\t\tendPos=vec4(limit(posnew, u_limitCentrePosition, u_limitMovementValue), 1.0);\n\t\t\t\t}else{\n\t\t\t\t\tendPos=vec4(posnew, 1.0);\n\t\t\t\t}\n\n\t\t\t\tworldPosition=modelMatrix * endPos;\n\t\t\t\t\n\t\t\t\tvec4 mvPosition=viewMatrix * worldPosition;\n\t\t\t\tgl_Position=projectionMatrix * mvPosition;\n\n\t\t\t\tv_pos=pos.xyz;\n\n\t\t\t\t//-- Add v_lifetime Here --\n\n\t\t\t\t//-- Add stayOnScreen Here --\n\n\t\t\t\tfloat sizeChangeOnGrav=length(pos.xyz) / 5.0;\n\t\t\t\tgl_PointSize=(u_pointSize) * textureCV.w * clamp(sizeChangeOnGrav, 0.75, 1.5);\n\t\t\t}\n\t\t",o="\n\t\t\tfloat resize(inout float x, float wholeLocal){\n\t\t\t\treturn abs(x / wholeLocal);\n\t\t\t}\n\n\t\t\tuniform sampler2D u_particleTexture;\n\t\t\tuniform float u_colorArray[30];\n\t\t\tuniform float u_time;\n\t\t\tuniform float u_colorImageMixValue;\n\n\t\t\tvarying vec3 v_pos;\n\t\t\tvarying float v_lifetime;\n\t\t\tvarying vec2 v_uv;\n\t\t\t\n\t\t\tvoid main(){\n\n\t\t\t\t//-- Add ColorCode Here --\n\n\t\t\t\tif(b.w > 0.1){\n\t\t\t\t\tgl_FragColor=mix(c, b, u_colorImageMixValue / 100.0);\n\t\t\t\t\tgl_FragColor.w=v_lifetime;\n\t\t\t\t}\n\n\t\t\t}\n\t\t",g(this),(t.showHelper||t.gravPointsVisible)&&(this.axesHelper=new THREE.AxesHelper(5),this.scene.add(this.axesHelper)),this.createScene(),this.bindedRender=this.render.bind(this)}else this.destroy()}function g(t){var e=Math.tan(t.camera.fov/2)*(t.camera.position.z+12)*2;return{x:t.camera.aspect*e,y:e}}function d(t){t.gravPositions[0]=t.g1X,t.gravPositions[1]=t.g1Y,t.gravPositions[2]=t.g1Z,t.gravPositions[3]=t.g2X,t.gravPositions[4]=t.g2Y,t.gravPositions[5]=t.g2Z,t.gravPositions[6]=t.g3X,t.gravPositions[7]=t.g3Y,t.gravPositions[8]=t.g3Z}function v(t,e){var i=e.theCluster;i.speed=parseFloat(i.speed),t.speed=i.speed/100,t.size=i.size/5,t.randSizeMin=i.randSizeMin,t.randSizeMax=i.randSizeMax,t.scale=i.groShr/100,t.angle=i.angle,t.tilt=i.tilt,t.horizontal=i.offsetX,t.vertical=i.offsetY,t.zoom=i.offsetZ,t.keepCentered=i.keepCentered,t.spawnForm=i.spawnForm,t.spawnAccVec=i.spawnAccVec,t.limitMovementValue=i.limitMovementValue,t.lifeTimeDelay=i.lifeTimeDelay,t.noiseAmount=i.noiseAmount,t.colorImageMixValue=i.colorImageMixValue}function p(t,e){var i=document.getElementById("wpsaddon_gravP"+t+"MoveSel");null!==i&void 0!==i&&(i.style.cssText=e?"opacity: 100%; pointer-events: auto;":"opacity: 50%; pointer-events: none;")}function h(t,e){var i=e.theCluster;t.mass=i.mass,t.mass2=i.mass2,t.mass3=i.mass3,t.g1X=i.g1X,t.g1Y=i.g1Y,t.g1Z=i.g1Z,t.g2X=i.g2X,t.g2Y=i.g2Y,t.g2Z=i.g2Z,t.g3X=i.g3X,t.g3Y=i.g3Y,t.g3Z=i.g3Z,t.aniX=i.aniX,t.aniY=i.aniY,t.aniZ=i.aniZ,t.gravPoint1Toggle&&(t.gravPointArray[0].material.color.set(16721765),t.gravPointArray[0].position.x=t.g1X,t.gravPointArray[0].position.y=t.g1Y,t.gravPointArray[0].position.z=t.g1Z),t.gravPoint2Toggle&&(t.gravPointArray[1].material.color.set(890098),t.gravPointArray[1].position.x=t.g2X,t.gravPointArray[1].position.y=t.g2Y,t.gravPointArray[1].position.z=t.g2Z),t.gravPoint3Toggle&&(t.gravPointArray[2].material.color.set(3274158),t.gravPointArray[2].position.x=t.g3X,t.gravPointArray[2].position.y=t.g3Y,t.gravPointArray[2].position.z=t.g3Z),function(t){t.limitCentrePosition.set(parseFloat(t.g1X)+parseFloat(t.g2X)+parseFloat(t.g3X),parseFloat(t.g1Y)+parseFloat(t.g2Y)+parseFloat(t.g3Y),parseFloat(t.g1Z)+parseFloat(t.g2Z)+parseFloat(t.g3Z)).multiplyScalar(1/3)}(t),d(t)}function f(t){return(t=tpGS.gsap.utils.splitColor(t)).length<=3&&(t[3]=1),t}function x(t,e){t.scene.rotation.z=e.angle*Math.PI/180,t.scene.rotation.x=e.tilt*Math.PI/180,t.camera.position.x=e.horizontal,t.camera.position.y=e.vertical,t.camera.position.z=e.zoom+22,e.keepCentered&&t.camera.lookAt(0,0,0)}function y(t){return _R_is_Editor?t:1==t}function _(t){return _R_is_Editor?RVS.LIB.RSCLUSTER[t.settings.lid]:l[t.settings.sid]._L[t.settings.lid]}function C(t){(t===1/0||isNaN(t))&&(t=0);var e=function(t){var e=t.toString().split(".")[1];return void 0===e?0:e.length}(t);return 0===e?parseFloat(t).toFixed(1):parseFloat(t).toFixed(e)}jQuery.extend(!0,l,{theClusterBuild:{getBasics:function(){return{speed:25,limitMovement:!1,limitMovementValue:15,noiseOn:!1,noiseAmount:50,angle:0,tilt:0,showHelper:!1,keepCentered:!0,offsetX:0,offsetY:0,offsetZ:0,dpr:1,gravPointsVisible:!1,g1X:-5,g1Y:0,g1Z:0,g2X:0,g2Y:0,g2Z:0,g3X:5,g3Y:0,g3Z:0,mass:30,mass2:30,mass3:30,gravPoint1Toggle:!1,gravPoint2Toggle:!0,gravPoint3Toggle:!1,spawnDiameter:50,amount:900,spawnForm:"random",spawnAccVec:"normalCW",sIX:10,sIY:7,sIZ:0,sVX:1,sVY:0,sVZ:0,mirroredOn:0,size:22,randomizeSize:!0,tc_mainColor:"{&type&:&radial&,&angle&:&0&,&colors&:[{&r&:255,&g&:248,&b&:0,&a&:1,&position&:0,&align&:&bottom&},{&r&:255,&g&:248,&b&:0,&a&:1,&position&:0,&align&:&top&},{&r&:255,&g&:19,&b&:97,&a&:1,&position&:33,&align&:&bottom&},{&r&:68,&g&:16,&b&:122,&a&:1,&position&:71,&align&:&bottom&},{&r&:35,&g&:21,&b&:87,&a&:1,&position&:100,&align&:&top&},{&r&:35,&g&:21,&b&:87,&a&:1,&position&:100,&align&:&bottom&}],&easing&:&none&,&strength&:100}",particle:"default",randomizeOpacity:!0,randSizeMin:50,randSizeMax:150,colorImageMixValue:0,animationSel:"off",aniX:0,aniY:0,aniZ:0,patternSel:"continuous",lifeTimeDelay:5,lifetimeAlphaChange:"fadeInOut",lifeTimeGradient:!1,gravP1MoveSel:"off",gravP2MoveSel:"off",gravP3MoveSel:"off",periodicSpawn:!0,periodicSpawnValue:1,gravFollowMouse:"off",gravFollowMouseValue:50,gravRotateMouseValue:30,gravRotateReturnValue:30,vfxSelector:"off",focus:50,maxBlur:10,minBlur:0,aperture:5,sfxBreathing:!0}}},theClusterInit:function(t,e){l.TWOMPI=l.TWOMPI||2*Math.PI,l.DEGTORAD=l.DEGTORAD||Math.PI/180,l.theClusterUrl=void 0===e.url?"":e.url,THREE.Cache.enabled=!0,l.theClusterUtils.observe(t)},theClusterUtils:{observe:function(t){l[t].c.on("layerinitialised",(function(e,i){void 0!==l[t]._L[i.layer]&&l[t]._L[i.layer].c[0].className.indexOf("tp-thecluster")>=0&&l.theClusterUtils.initLayer(t,i.layer)})),l[t].c.on("revolution.layeraction",(function(e,i){if(null!=l[t]._L[i.layerid]&&-1!==l[t]._L[i.layerid].c[0].className.indexOf("tp-thecluster"))if("enterstage"===i.eventtype)l[t]._L[i.layerid].clusterInited?null==l[t]._L[i.layerid].theCluster&&(l.theClusterUtils.initLayer(t,i.layerid),requestAnimationFrame((function(){l.theClusterUtils.setLayer(l[t]._L[i.layerid])}))):(l[t]._L[i.layerid].clusterInited=!0,requestAnimationFrame((function(){l.theClusterUtils.setLayer(l[t]._L[i.layerid])}))),l.theClusterUtils.fitCameraToObject(l[t]._L[i.layerid]),l[t]._L[i.layerid].theCluster.pauseTimer&&l[t]._L[i.layerid].theCluster.pauseTimer.kill&&l[t]._L[i.layerid].theCluster.pauseTimer.kill();else if("leavestage"===i.eventtype&&l[t]._L[i.layerid]&&l[t]._L[i.layerid].theCluster&&l[t]._L[i.layerid].theCluster.cluster){var n=l[t]._L[i.layerid].theCluster.cluster;l[t]._L[i.layerid].theCluster.pauseTimer=tpGS.gsap.delayedCall(l[t]._L[i.layerid].frames.frame_999.timeline.speed/1e3,(function(){n.paused=!0,n.frame=cancelAnimationFrame(n.frame),n.destroy(),l[t]._L[i.layerid].theCluster=void 0}))}})),l[t].c.on("leftviewport",(function(){for(var e in l[t]._L)if(l[t]._L.hasOwnProperty(e)&&l[t]._L[e]&&l[t]._L[e].theCluster&&l[t]._L[e].theCluster.cluster){var i=l[t]._L[e].theCluster.cluster;i.paused=!0,i.frame=cancelAnimationFrame(i.frame),i.destroy(),l[t]._L[e].theCluster=void 0}})).on("enterviewport",(function(){for(var e in l[t]._L)l[t]._L.hasOwnProperty(e)&&l[t]._L[e]&&l[t].pr_active_key==l[t]._L[e].slideIndex&&-1!==l[t]._L[e].c[0].className.indexOf("tp-thecluster")&&null==l[t]._L[e].theCluster&&(l.theClusterUtils.initLayer(t,e),requestAnimationFrame((function(){l.theClusterUtils.setLayer(l[t]._L[e])})))}))},initLayer:function(t,e){if(null==l[t]._L[e]||void 0===l[t]._L[e].theCluster){var i,n,r=l[t]._L[e];r.theCluster=l.theClusterUtils.getWebGLCanvas(),r.theCluster=jQuery.extend(!0,r.theCluster,l.theClusterBuild.getBasics());var s=r.theCluster;if(s.sid=t,s.lid=e,s.sliderId=t,void 0!==r.clusterdata)for(i in r.clusterdata="object"==typeof r.clusterdata?r.clusterdata:r.clusterdata.split(";"),r.clusterdata)if(r.clusterdata.hasOwnProperty(i))if((r.clusterdata[i]+"").indexOf("{")>=0)0==(r.clusterdata[i]+"").indexOf("pc:")&&(s.tc_mainColor=(r.clusterdata[i]+"").replace("pc:",""));else switch((n=r.clusterdata[i].split(":"))[0]){case"ms":s.speed=n[1];break;case"mm":s.mass=n[1];break;case"mm2":s.mass2=n[1];break;case"mm3":s.mass3=n[1];break;case"mi":s.size=n[1];break;case"mp":s.spawnDiameter=n[1];break;case"ma":s.amount=n[1];break;case"sa":s.angle=n[1];break;case"st":s.tilt=n[1];break;case"sh":s.showHelper=n[1];break;case"sx":s.offsetX=n[1];break;case"sy":s.offsetY=n[1];break;case"sz":s.offsetZ=n[1];break;case"sk":s.keepCentered=n[1];break;case"sd":s.dpr=n[1];break;case"sf":s.spawnForm=n[1];break;case"mc":s.spawnAccVec=n[1];break;case"g1X":s.g1X=n[1];break;case"g1Y":s.g1Y=n[1];break;case"g1Z":s.g1Z=n[1];break;case"g2X":s.g2X=n[1];break;case"g2Y":s.g2Y=n[1];break;case"g2Z":s.g2Z=n[1];break;case"g3X":s.g3X=n[1];break;case"g3Y":s.g3Y=n[1];break;case"g3Z":s.g3Z=n[1];break;case"gl":s.limitMovement=n[1];break;case"gv":s.limitMovementValue=n[1];break;case"sIX":s.sIX=n[1];break;case"sIY":s.sIY=n[1];break;case"sIZ":s.sIZ=n[1];break;case"sVX":s.sVX=n[1];break;case"sVY":s.sVY=n[1];break;case"sVZ":s.sVZ=n[1];break;case"pc":s.tc_mainColor=n[1];break;case"gp":s.gravPointsVisible=n[1];break;case"pr":s.randomizeSize=n[1];break;case"pp":s.particle=n[1];break;case"as":s.animationSel=n[1];break;case"aniX":s.aniX=n[1];break;case"aniY":s.aniY=n[1];break;case"aniZ":s.aniZ=n[1];break;case"sM":s.mirroredOn=n[1];break;case"mps":s.patternSel=n[1];break;case"ld":s.lifeTimeDelay=n[1];break;case"mn":s.noiseOn=n[1];break;case"mf":s.noiseAmount=n[1];break;case"ml":s.lifetimeAlphaChange=n[1];break;case"mg":s.lifeTimeGradient=n[1];break;case"mp1":s.gravP1MoveSel=n[1];break;case"mp2":s.gravP2MoveSel=n[1];break;case"mp3":s.gravP3MoveSel=n[1];break;case"po":s.randomizeOpacity=n[1];break;case"msp":s.periodicSpawn=n[1];break;case"msv":s.periodicSpawnValue=n[1];break;case"t1":s.gravPoint1Toggle=n[1];break;case"t2":s.gravPoint2Toggle=n[1];break;case"t3":s.gravPoint3Toggle=n[1];break;case"pin":s.randSizeMin=n[1];break;case"pax":s.randSizeMax=n[1];break;case"cim":s.colorImageMixValue=n[1];break;case"ifm":s.gravFollowMouse=n[1];break;case"ifv":s.gravFollowMouseValue=n[1];break;case"vfx":s.vfxSelector=n[1];break;case"vbr":s.sfxBreathing=n[1];break;case"vmi":s.minBlur=n[1];break;case"vma":s.maxBlur=n[1];break;case"ifr":s.gravRotateMouseValue=n[1];break;case"ifn":s.gravRotateReturnValue=n[1]}r.c.find("canvas").remove(),r.c[0].appendChild(s.canvas)}},initBackendLayer:function(t,e){var i,n,r,s;_R_is_Editor&&(void 0===RVS.LIB.RSCLUSTER&&(RVS.LIB.RSCLUSTER={}),i=RVS.LIB.RSCLUSTER[t]?RVS.LIB.RSCLUSTER[t]:{},RVS.LIB.RSCLUSTER[t]=i,RVS.LIB.RSCLUSTER[t]&&RVS.LIB.RSCLUSTER[t].theCluster&&RVS.LIB.RSCLUSTER[t].theCluster.cluster&&(r=Math.round(RVS.H[i.lid].c[0].clientWidth),s=Math.round(RVS.H[i.lid].c[0].clientHeight),r===(n=RVS.LIB.RSCLUSTER[t].theCluster).cluster.settings.width&&s===n.cluster.settings.height&&!e))||i.waiting||(RVS.LIB.RSCLUSTER[t]&&RVS.LIB.RSCLUSTER[t].theCluster&&n&&(n.initCall&&n.initCall.kill(),n&&n.cluster&&n.cluster.destroy&&n.cluster.destroy(),i=RVS.LIB.RSCLUSTER[t]={}),l.TWOMPI=l.TWOMPI||2*Math.PI,l.DEGTORAD=l.DEGTORAD||Math.PI/180,void 0!==RVS&&void 0!==RVS.L&&void 0!==RVS.L[t]&&null!=RVS.L[t].addOns["revslider-thecluster-addon"]&&(i.theCluster=l.theClusterUtils.getWebGLCanvas(),i.theCluster=jQuery.extend(!0,RVS._R.theClusterBuild.getBasics(),i.theCluster),i.theCluster=jQuery.extend(!0,i.theCluster,RVS.L[t].addOns["revslider-thecluster-addon"]),i.lid=t,i.waiting=!0,i.theCluster.initCall=tpGS.gsap.delayedCall(.3,(function(){i.waiting=!1,i.destroyed||RVS.L[t]&&(i.eow=RVS.L[t].size.width[RVS.screen].v.indexOf&&-1!==RVS.L[t].size.width[RVS.screen].v.indexOf("%")?RVS.H[t].c.width():parseInt(RVS.L[t].size.width[RVS.screen].v,0),i.eoh=RVS.L[t].size.height[RVS.screen].v.indexOf&&-1!==RVS.L[t].size.height[RVS.screen].v.indexOf("%")?RVS.H[t].c.height():parseInt(RVS.L[t].size.height[RVS.screen].v,0),RVS.H[t].c[0].appendChild(i.theCluster.canvas),l.theClusterUtils.layers=void 0===l.theClusterUtils.layers?{}:l.theClusterUtils.layers,i.theCluster.id=RVS.S.slideId,i.theCluster.lid=t,l.theClusterUtils.layers[RVS.S.slideId+"_"+t]=i,l.theClusterUtils.setLayer(i),l.theClusterUtils.fitCameraToObject(i))}))))},setLayer:function(e){var i=e.theCluster;i.size=parseFloat(i.size),i.angle=parseFloat(i.angle),i.tilt=parseFloat(i.tilt),i.offsetX=parseFloat(i.offsetX),i.offsetY=parseFloat(i.offsetY),i.offsetZ=parseFloat(i.offsetZ),i.mass=parseFloat(i.mass),i.mass2=parseFloat(i.mass2),i.mass3=parseFloat(i.mass3),i.spawnDiameter=parseFloat(i.spawnDiameter)/10,i.g1X=parseFloat(i.g1X),i.g1Y=parseFloat(i.g1Y),i.g1Z=parseFloat(i.g1Z),i.g2X=parseFloat(i.g2X),i.g2Y=parseFloat(i.g2Y),i.g2Z=parseFloat(i.g2Z),i.g3X=parseFloat(i.g3X),i.g3Y=parseFloat(i.g3Y),i.g3Z=parseFloat(i.g3Z),i.sIX=parseFloat(i.sIX),i.sIY=parseFloat(i.sIY),i.sIZ=parseFloat(i.sIZ),i.sVX=parseFloat(i.sVX),i.sVY=parseFloat(i.sVY),i.sVZ=parseFloat(i.sVZ),i.aniX=parseFloat(i.aniX),i.aniY=parseFloat(i.aniY),i.aniZ=parseFloat(i.aniZ),i.limitMovementValue=parseFloat(i.limitMovementValue),i.lifeTimeDelay=Math.abs(parseFloat(i.lifeTimeDelay)/10-2.1),i.noiseAmount=parseFloat(i.noiseAmount)/100,i.periodicSpawnValue=parseFloat(i.periodicSpawnValue),i.randSizeMin=parseFloat(i.randSizeMin),i.randSizeMax=parseFloat(i.randSizeMax),i.colorImageMixValue=parseFloat(i.colorImageMixValue),i.gravFollowMouseValue=parseFloat(i.gravFollowMouseValue),i.gravRotateMouseValue=parseFloat(i.gravRotateMouseValue),i.gravRotateReturnValue=parseFloat(i.gravRotateReturnValue)/1e4,i.focus=parseFloat(i.focus),i.maxBlur=.001*parseFloat(i.maxBlur),i.minBlur=.001*parseFloat(i.minBlur),i.aperture=1e-5*parseFloat(i.aperture),_R_is_Editor&&void 0===RVS.ENV.THECLUSTER_URL&&(RVS.ENV.THECLUSTER_URL="//"+window.location.host+"/wp-content/plugins/revslider-thecluster-addon/"),"default"===i.particle&&(i.particle=_R_is_Editor?RVS.ENV.THECLUSTER_URL+"public/lib/par2.png":l.theClusterUrl+"public/lib/par2.png"),-1!==i.particle.indexOf(".svg")&&(i.svg=!0),void 0===t&&(t=new THREE.Clock),i.settings={},i.settings.size=i.size/5,i.settings.amount=Math.floor(Math.sqrt(parseFloat(i.amount))),i.settings.icon=i.particle,i.settings.width=e.eow,i.settings.height=e.eoh,i.settings.canvas=i.canvas,i.settings.showHelper=i.showHelper,i.settings.keepCentered=i.keepCentered,i.settings.mass=i.mass,i.settings.mass2=i.mass2,i.settings.mass3=i.mass3,i.settings.spawnDiameter=i.spawnDiameter,i.settings.renderTexturePos,i.settings.renderTextureVcc,i.settings.renderTextureCustomValues,i.settings.renderTextureInitPos,i.settings.renderTextureInitVCC,i.settings.computePos,i.settings.computeVcc,i.settings.computeCustomValues,i.settings.computeInitPos,i.settings.computeInitVCC,i.settings.vccVector=[0,0,0,0,0,0,0,0],i.settings.arrowHelper,i.settings.clusterPoint,i.settings.dpr=parseFloat(i.dpr),i.settings.spawnForm=i.spawnForm,i.settings.spawnAccVec=i.spawnAccVec,i.settings.gravPointCounter=0,i.settings.gravPointArray=[new THREE.Vector3],i.settings.gravPositions=[0,0,0,0,0,0,0,0,0],i.settings.g1X=i.g1X,i.settings.g1Y=i.g1Y,i.settings.g1Z=i.g1Z,i.settings.g2X=i.g2X,i.settings.g2Y=i.g2Y,i.settings.g2Z=i.g2Z,i.settings.g3X=i.g3X,i.settings.g3Y=i.g3Y,i.settings.g3Z=i.g3Z,i.settings.limitMovement=y(i.limitMovement),i.settings.limitMovementValue=i.limitMovementValue,i.settings.limitCentrePosition=new THREE.Vector3(0,0,0),i.settings.sIX=i.sIX,i.settings.sIY=i.sIY,i.settings.sIZ=i.sIZ,i.settings.sVX=i.sVX,i.settings.sVY=i.sVY,i.settings.sVZ=i.sVZ,i.settings.gravPointsVisible=i.gravPointsVisible,i.settings.randomizeSize=i.randomizeSize,i.settings.tc_mainColorOri=f(_R_is_Editor?RSColor.get(i.tc_mainColor):i.tc_mainColor),i.settings.tc_mainColor=f(i.tc_mainColor),i.settings.isGradient=_R_is_Editor?-1!=RSColor.get(i.tc_mainColor).indexOf("gradient"):-1!=i.tc_mainColor.indexOf("gradient"),i.settings.isRadGradient=_R_is_Editor?-1!=RSColor.get(i.tc_mainColor).indexOf("radial"):-1!=i.tc_mainColor.indexOf("radial"),i.settings.draggable=null,i.settings.convertedPos=new THREE.Vector3,i.settings.animationSel=i.animationSel,i.settings.aniX=i.aniX,i.settings.aniY=i.aniY,i.settings.aniZ=i.aniZ,i.settings.mirroredOn=i.mirroredOn,i.settings.patternSel=i.patternSel,i.settings.lifeTimeDelay=i.lifeTimeDelay,i.settings.noiseOn=i.noiseOn,i.settings.noiseAmount=i.noiseAmount.toFixed(2),i.settings.lifetimeAlphaChange=i.lifetimeAlphaChange,i.settings.lifeTimeGradient=y(i.lifeTimeGradient),i.settings.gravP1MoveSel=i.gravP1MoveSel,i.settings.gravP2MoveSel=i.gravP2MoveSel,i.settings.gravP3MoveSel=i.gravP3MoveSel,i.settings.randomizeOpacity=y(i.randomizeOpacity),i.settings.periodicSpawn=y(i.periodicSpawn),i.settings.periodicSpawnValue=i.periodicSpawnValue,i.settings.gravPoint1Toggle=y(i.gravPoint1Toggle),i.settings.gravPoint2Toggle=y(i.gravPoint2Toggle),i.settings.gravPoint3Toggle=y(i.gravPoint3Toggle),i.settings.randSizeMin=i.randSizeMin,i.settings.randSizeMax=i.randSizeMax,i.settings.colorImageMixValue=i.colorImageMixValue,i.settings.mouseVec=new THREE.Vector2,i.settings.mouseMoveVec=new THREE.Vector2,i.settings.mouseOnLayer=!1,i.settings.gravFollowMouse=i.gravFollowMouse,i.settings.gravFollowMouseValue=i.gravFollowMouseValue,i.settings.gravRotateMouseValue=i.gravRotateMouseValue,i.settings.gravRotateReturnValue=i.gravRotateReturnValue,i.settings.vfxSelector=i.vfxSelector,i.settings.focus=i.focus,i.settings.maxBlur=i.maxBlur,i.settings.minBlur=i.minBlur,i.settings.aperture=i.aperture,i.settings.sfxBreathing=i.sfxBreathing,v(i.settings,e),i.settings.lid=i.lid,i.settings.sid=i.sid,i.settings.isSVG=i.svg,i.settings.tcanv=document.createElement("canvas"),function(t,e,i,n,r){i*=100*window.devicePixelRatio*(n+1);var s=e.getContext("2d"),a=new Image;a.crossOrigin="Anonymous",-1==t.indexOf(".svg")?(a.crossOrigin="Anonymous",a.onload=function(){u(this.naturalWidth,this.naturalHeight,i,a,s,r)},a.src=t):jQuery.ajax({url:t,accepts:"image/svg+xml",complete:function(t){for(var e=t.responseText,n=jQuery(e),a=0;a([\s\S]*?)<\/metadata>/g,"");var c=new Image,m="data:image/svg+xml;base64,"+btoa(e);u(o,l,i,c,s,r,m)}else console.error("Failed to load svg, please make sure used SVG file contains valid SVG code or make sure server delivers SVG file with correct CORS permission headers.")},error:function(){u(0,0,i,a,s,r,t)}})}(i.settings.icon,i.settings.tcanv,i.settings.size,1,(function(){i.cluster=new m(i.settings,e),i.cluster.destroyed||(i.cluster.resize(e.eow,e.eoh),h(i.settings,e),i.cluster.render())}))},updateLayer:function(t,e,i,n,r){void 0!==l.theClusterUtils.layers[t+"_"+e]&&(l.theClusterUtils.layers[t+"_"+e].theCluster[i]=n,v(l.theClusterUtils.layers[t+"_"+e].theCluster.settings,l.theClusterUtils.layers[t+"_"+e]),l.theClusterUtils.layers[t+"_"+e].theCluster.cluster.update())},updateGravPoints:function(t,e,i,n,r){void 0!==l.theClusterUtils.layers[t+"_"+e]&&(l.theClusterUtils.layers[t+"_"+e].theCluster[i]=n,h(l.theClusterUtils.layers[t+"_"+e].theCluster.settings,l.theClusterUtils.layers[t+"_"+e]),l.theClusterUtils.layers[t+"_"+e].theCluster.cluster.update())},splitColor:function(t){return 3==(t=tpGS.gsap.utils.splitColor(t)).length&&(t[3]=1),t[0]/=255,t[1]/=255,t[2]/=255,t},fitCameraToObject:function(t){var e,i,n=t.theCluster;t.theCluster.cluster&&t.c&&(window._R_is_Editor?(e=Math.round(RVS.H[t.lid].c[0].clientWidth),i=Math.round(RVS.H[t.lid].c[0].clientHeight)):(e=Math.round(t.eow),i=Math.round(t.eoh)),e=isNaN(e)?0:e,i=n.settings.height=isNaN(i)?0:i,n.lastDim={width:e,height:i},e===n.settings.width&&i===n.settings.height||(n.settings.width=e,n.settings.height=i,n.cluster.destroy(),n.settings.canvas=t.theCluster.canvas=l.theClusterUtils.getWebGLCanvas().canvas,t.c[0].appendChild(n.settings.canvas),n.cluster=new m(n.settings,t)),n.cluster.paused=!1,n.cluster.initPP(),cancelAnimationFrame(n.cluster.frame),n.cluster.destroyed||(n.cluster.frame=requestAnimationFrame(n.cluster.bindedRender)))},getWebGLCanvas:function(){let t=document.createElement("canvas");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.zIndex=2,t.width=1600,t.height=1200,{canvas:t}}}}),m.prototype.createScene=function(){var t,l=this.settings;if(l.textureCanvas=new THREE.CanvasTexture(l.tcanv),l.textureCanvas.needsUpdate=!0,function(t){for(let e=0;e<9;e++)t.settings.gravPositions[e]=0;for(let r=0;r<3;r++){var e=new THREE.SphereGeometry(.4,7,7),i=new THREE.MeshBasicMaterial({color:3274158,transparent:!0}),n=new THREE.Mesh(e,i);t.settings.gravPointArray[r]=n,t.scene.add(t.settings.gravPointArray[r]),t.settings.gravPositions[3*r+0]=0,t.settings.gravPositions[3*r+1]=0,t.settings.gravPositions[3*r+2]=0,n.userData.draggable=!0,n.userData.name=r+1}}(this),(t=this).settings.g1X=t.settings.gravPositions[0],t.settings.g1Y=t.settings.gravPositions[1],t.settings.g1Z=t.settings.gravPositions[2],t.settings.g2X=t.settings.gravPositions[3],t.settings.g2Y=t.settings.gravPositions[4],t.settings.g2Z=t.settings.gravPositions[5],t.settings.g3X=t.settings.gravPositions[6],t.settings.g3Y=t.settings.gravPositions[7],t.settings.g3Z=t.settings.gravPositions[8],function(t){var i=t.settings;i.gravPoint1Toggle&&(s=s.replace("//-- Add G1 Here --","\n\t\t\t\tvec3 g1=pos - vec3(u_gravPositions[0], u_gravPositions[1], u_gravPositions[2]);\n\t\t\t\tsumVector +=normalize(g1) * length(g1) * gravCo * u_mass;\n\t\t\t"));i.gravPoint2Toggle&&(s=s.replace("//-- Add G2 Here --","\n\t\t\t\tvec3 g2=pos - vec3(u_gravPositions[3], u_gravPositions[4], u_gravPositions[5]);\n\t\t\t\tsumVector +=normalize(g2) * length(g2) * gravCo * u_mass2;\n\t\t\t"));i.gravPoint3Toggle&&(s=s.replace("//-- Add G3 Here --","\n\t\t\t\tvec3 g3=pos - vec3(u_gravPositions[6], u_gravPositions[7], u_gravPositions[8]);\n\t\t\t\tsumVector +=normalize(g3) * length(g3) * gravCo * u_mass3;\n\t\t\t"));s=s.replace("//-- Add G4 Here --",`\n\t\t\tif(u_mouseOnLayer){\n\t\t\t\tvec3 g4=pos - vec3(u_mouseVector.x, u_mouseVector.y, 0.0);\n\t\t\t\tsumVector +=normalize(g4) * length(g4) * gravCo * ${(10*i.gravFollowMouseValue).toFixed(1)};\n\t\t\t}\n\t\t`),"lifetime"==i.patternSel&&("fadeInOut"==i.lifetimeAlphaChange&&(s=s.replace("//-- Add Modified Vel Here --",`\n\t\t\t\t\tfloat lt=sin((u_time * ${i.lifeTimeDelay.toFixed(1)}) + textureVel.w * 6.28);\n\n\t\t\t\t\tif(lt < 0.0){\n\t\t\t\t\t\tvel.xyz=textureInitVCC.xyz;\n\t\t\t\t\t}\n\t\t\t\t`)),"fadeIn"==i.lifetimeAlphaChange&&(s=s.replace("//-- Add Modified Vel Here --",`\n\t\t\t\t\tfloat x=u_time * ${i.lifeTimeDelay.toFixed(1)} + textureVel.w * 6.28;\n\t\t\t\t\tfloat lt=sin(x)- 0.5 * sin(2.0 * x);\n\n\t\t\t\t\tif(lt < 0.0){\n\t\t\t\t\t\tvel.xyz=textureInitVCC.xyz;\n\t\t\t\t\t}\n\t\t\t\t`)),"fadeOut"==i.lifetimeAlphaChange&&(s=s.replace("//-- Add Modified Vel Here --",`\n\t\t\t\t\tfloat x=u_time * ${i.lifeTimeDelay.toFixed(1)} + textureVel.w * 6.28;\n\t\t\t\t\tfloat lt=-sin(x) + 0.5 * sin(2.0 * x);\n\n\t\t\t\t\tif(lt < 0.0){\n\t\t\t\t\t\tvel.xyz=textureInitVCC.xyz;\n\t\t\t\t\t}\n\t\t\t\t`)));i.noiseOn&&(s=(s=s.replace("//-- Add Noise Methods Here --","\n\t\t\t\tvec4 mod289(vec4 x){\n\t\t\t\t\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfloat mod289(float x){\n\t\t\t\t\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvec4 permute(vec4 x){\n\t\t\t\t\treturn mod289(((x*34.0)+1.0)*x);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfloat permute(float x){\n\t\t\t\t\treturn mod289(((x*34.0)+1.0)*x);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvec4 taylorInvSqrt(vec4 r){\n\t\t\t\t\treturn 1.79284291400159 - 0.85373472095314 * r;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfloat taylorInvSqrt(float r){\n\t\t\t\t\treturn 1.79284291400159 - 0.85373472095314 * r;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvec4 grad4(float j, vec4 ip){\n\t\t\t\t\tconst vec4 ones=vec4(1.0, 1.0, 1.0, -1.0);\n\t\t\t\t\tvec4 p,s;\n\t\t\t\t\n\t\t\t\t\tp.xyz=floor(fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n\t\t\t\t\tp.w=1.5 - dot(abs(p.xyz), ones.xyz);\n\t\t\t\t\ts=vec4(lessThan(p, vec4(0.0)));\n\t\t\t\t\tp.xyz=p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\t\t\t\t\n\t\t\t\t\treturn p;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t#define F4 0.309016994374947451\n\t\t\t\t\n\t\t\t\tvec4 snoise4 (vec4 v){\n\t\t\t\t\tconst vec4 C=vec4(0.138196601125011,0.276393202250021,0.414589803375032,-0.447213595499958);\n\t\t\t\t\n\t\t\t\t\tvec4 i=floor(v + dot(v, vec4(F4)));\n\t\t\t\t\tvec4 x0=v - i + dot(i, C.xxxx);\n\t\t\t\t\n\t\t\t\t\tvec4 i0;\n\t\t\t\t\tvec3 isX=step(x0.yzw, x0.xxx);\n\t\t\t\t\tvec3 isYZ=step(x0.zww, x0.yyz);\n\t\t\t\t\ti0.x=isX.x + isX.y + isX.z;\n\t\t\t\t\ti0.yzw=1.0 - isX;\n\t\t\t\t\ti0.y +=isYZ.x + isYZ.y;\n\t\t\t\t\ti0.zw +=1.0 - isYZ.xy;\n\t\t\t\t\ti0.z +=isYZ.z;\n\t\t\t\t\ti0.w +=1.0 - isYZ.z;\n\t\t\t\t\n\t\t\t\t\tvec4 i3=clamp(i0, 0.0, 1.0);\n\t\t\t\t\tvec4 i2=clamp(i0-1.0, 0.0, 1.0);\n\t\t\t\t\tvec4 i1=clamp(i0-2.0, 0.0, 1.0);\n\t\t\t\t\n\t\t\t\t\tvec4 x1=x0 - i1 + C.xxxx;\n\t\t\t\t\tvec4 x2=x0 - i2 + C.yyyy;\n\t\t\t\t\tvec4 x3=x0 - i3 + C.zzzz;\n\t\t\t\t\tvec4 x4=x0 + C.wwww;\n\t\t\t\t\n\t\t\t\t\ti=mod289(i);\n\t\t\t\t\tfloat j0=permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x);\n\t\t\t\t\tvec4 j1=permute(permute(permute(permute (\n\t\t\t\t\t\t\ti.w + vec4(i1.w, i2.w, i3.w, 1.0))\n\t\t\t\t\t\t+ i.z + vec4(i1.z, i2.z, i3.z, 1.0))\n\t\t\t\t\t\t+ i.y + vec4(i1.y, i2.y, i3.y, 1.0))\n\t\t\t\t\t\t+ i.x + vec4(i1.x, i2.x, i3.x, 1.0));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tvec4 ip=vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\t\t\t\t\n\t\t\t\t\tvec4 p0=grad4(j0, ip);\n\t\t\t\t\tvec4 p1=grad4(j1.x, ip);\n\t\t\t\t\tvec4 p2=grad4(j1.y, ip);\n\t\t\t\t\tvec4 p3=grad4(j1.z, ip);\n\t\t\t\t\tvec4 p4=grad4(j1.w, ip);\n\t\t\t\t\n\t\t\t\t\tvec4 norm=taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\n\t\t\t\t\tp0 *=norm.x;\n\t\t\t\t\tp1 *=norm.y;\n\t\t\t\t\tp2 *=norm.z;\n\t\t\t\t\tp3 *=norm.w;\n\t\t\t\t\tp4 *=taylorInvSqrt(dot(p4,p4));\n\t\t\t\t\n\t\t\t\t\tvec3 values0=vec3(dot(p0, x0), dot(p1, x1), dot(p2, x2)); //value of contributions from each corner at point\n\t\t\t\t\tvec2 values1=vec2(dot(p3, x3), dot(p4, x4));\n\t\t\t\t\n\t\t\t\t\tvec3 m0=max(0.5 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0); //(0.5 - x^2) where x is the distance\n\t\t\t\t\tvec2 m1=max(0.5 - vec2(dot(x3,x3), dot(x4,x4)), 0.0);\n\t\t\t\t\n\t\t\t\t\tvec3 temp0=-6.0 * m0 * m0 * values0;\n\t\t\t\t\tvec2 temp1=-6.0 * m1 * m1 * values1;\n\t\t\t\t\n\t\t\t\t\tvec3 mmm0=m0 * m0 * m0;\n\t\t\t\t\tvec2 mmm1=m1 * m1 * m1;\n\t\t\t\t\n\t\t\t\t\tfloat dx=temp0[0] * x0.x + temp0[1] * x1.x + temp0[2] * x2.x + temp1[0] * x3.x + temp1[1] * x4.x + mmm0[0] * p0.x + mmm0[1] * p1.x + mmm0[2] * p2.x + mmm1[0] * p3.x + mmm1[1] * p4.x;\n\t\t\t\t\tfloat dy=temp0[0] * x0.y + temp0[1] * x1.y + temp0[2] * x2.y + temp1[0] * x3.y + temp1[1] * x4.y + mmm0[0] * p0.y + mmm0[1] * p1.y + mmm0[2] * p2.y + mmm1[0] * p3.y + mmm1[1] * p4.y;\n\t\t\t\t\tfloat dz=temp0[0] * x0.z + temp0[1] * x1.z + temp0[2] * x2.z + temp1[0] * x3.z + temp1[1] * x4.z + mmm0[0] * p0.z + mmm0[1] * p1.z + mmm0[2] * p2.z + mmm1[0] * p3.z + mmm1[1] * p4.z;\n\t\t\t\t\tfloat dw=temp0[0] * x0.w + temp0[1] * x1.w + temp0[2] * x2.w + temp1[0] * x3.w + temp1[1] * x4.w + mmm0[0] * p0.w + mmm0[1] * p1.w + mmm0[2] * p2.w + mmm1[0] * p3.w + mmm1[1] * p4.w;\n\t\t\t\t\n\t\t\t\t\treturn vec4(dx, dy, dz, dw) * 49.0;\n\t\t\t\t}\n\t\t\t\tvec3 curl(in vec3 p, in float noiseTime, in float persistence){\n\t\t\t\t\n\t\t\t\t\tvec4 xNoisePotentialDerivatives=vec4(0.0);\n\t\t\t\t\tvec4 yNoisePotentialDerivatives=vec4(0.0);\n\t\t\t\t\tvec4 zNoisePotentialDerivatives=vec4(0.0);\n\t\t\t\t\n\t\t\t\t\tfor (int i=0; i < 3; ++i){\n\t\t\t\t\n\t\t\t\t\t\tfloat twoPowI=pow(2.0, float(i));\n\t\t\t\t\t\tfloat scale=0.5 * twoPowI * pow(persistence, float(i));\n\t\t\t\t\n\t\t\t\t\t\txNoisePotentialDerivatives +=snoise4(vec4(p * twoPowI, noiseTime)) * scale;\n\t\t\t\t\t\tyNoisePotentialDerivatives +=snoise4(vec4((p + vec3(123.4, 129845.6, -1239.1)) * twoPowI, noiseTime)) * scale;\n\t\t\t\t\t\tzNoisePotentialDerivatives +=snoise4(vec4((p + vec3(-9519.0, 9051.0, -123.0)) * twoPowI, noiseTime)) * scale;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\treturn vec3(\n\t\t\t\t\t\tzNoisePotentialDerivatives[1] - yNoisePotentialDerivatives[2],\n\t\t\t\t\t\txNoisePotentialDerivatives[2] - zNoisePotentialDerivatives[0],\n\t\t\t\t\t\tyNoisePotentialDerivatives[0] - xNoisePotentialDerivatives[1]\n\t\t\t\t\t);\n\t\t\t\t\n\t\t\t\t}\n\t\t\t")).replace("//-- Add Noise Here --","\n\t\t\t\tvel +=normalize(curl(pos * 0.02, u_time, 0.01)) * (u_noiseAmount / 4.0);\n\t\t\t"));if(i.lifeTimeGradient)if(i.isGradient){var n=i.tc_mainColorOri[i.tc_mainColorOri.length-5]/255,r=i.tc_mainColorOri[i.tc_mainColorOri.length-4]/255,l=i.tc_mainColorOri[i.tc_mainColorOri.length-3]/255,u=i.tc_mainColorOri[i.tc_mainColorOri.length-2],c=1;i.tc_mainColorOri.length%5==0&&(c=0),o=o.replace("//-- Add ColorCode Here --",`\n\t\t\t\t\tconst int co1=${Math.round(n)};\n\t\t\t\t\tconst int co2=${Math.round(r)};\n\t\t\t\t\tconst int co3=${Math.round(l)};\n\t\t\t\t\tconst int co4=${Math.round(u)};\n\n\t\t\t\t\tvec4 c=vec4(co1, co2, co3, co4);\n\t\t\t\t\tconst int convert_i=${(i.tc_mainColorOri.length-c)/5};\n\t\t\t\t\tconst int cancelGardientAngle=${c};\n\n\t\t\t\t\tfor(int i=0; i=135&&(h="posVal.y - localH/2.0",p=d),i.tc_mainColorOri[0]<135&&i.tc_mainColorOri[0]>=45&&(h="posVal.x + localW/2.0",p=m),i.tc_mainColorOri[0]<45&&i.tc_mainColorOri[0]>=0&&(h="posVal.y + localH/2.0",p=d),i.tc_mainColorOri[0]<0&&i.tc_mainColorOri[0]>=315&&(h="posVal.y + localH/2.0",p=d),i.tc_mainColorOri[0]<315&&i.tc_mainColorOri[0]>=225&&(h="posVal.x - localW/2.0",p=m),o=o.replace("//-- Add ColorCode Here --",`\n\t\t\t\t\t\t\tvec3 posVal=v_pos;\n\t\t\t\t\t\t\tfloat localW=${m};\n\t\t\t\t\t\t\tfloat localH=${d};\n\t\t\t\t\t\t\tfloat length=${h};\n\t\t\t\t\t\t\tfloat selWH_recalc=${p};\n\t\t\t\t\t\t\tfloat l=resize(length, selWH_recalc);\n\t\n\t\t\t\t\t\t\tvec4 c=vec4(${n.toFixed(2)}, ${r.toFixed(2)}, ${l.toFixed(2)}, ${u.toFixed(2)});\n\t\t\t\t\t\t\tconst int convert_i=${(i.tc_mainColorOri.length-1)/5};\n\n\t\t\t\t\t\t\tfor(int i=0; i 0.0){\n\t\t\t\t\t\t\tvel=normalize(vel) * clamp(length(vel), minCo, maxCo);\n\t\t\t\t\t\t\tpos +=vel * 0.30 * u_speed;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tpos.xyz=textureInitPos.xyz;\n\t\t\t\t\t\t}\n\t\t\t\t\t`)),"fadeIn"==i.lifetimeAlphaChange&&(e=e.replace("//-- Add ParticleMove Here --",`\n\t\t\t\t\t\tfloat x=u_time * ${i.lifeTimeDelay.toFixed(1)} + textureVel.w * 6.28;\n\t\t\t\t\t\tfloat lifetime=sin(x)- 0.5 * sin(2.0 * x);\n\n\t\t\t\t\t\tif(lifetime > 0.0){\n\t\t\t\t\t\t\tvel=normalize(vel) * clamp(length(vel), minCo, maxCo);\n\t\t\t\t\t\t\tpos +=vel * 0.30 * u_speed;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tpos.xyz=textureInitPos.xyz;\n\t\t\t\t\t\t}\n\t\t\t\t\t`)),"fadeOut"==i.lifetimeAlphaChange&&(e=e.replace("//-- Add ParticleMove Here --",`\n\t\t\t\t\t\tfloat x=u_time * ${i.lifeTimeDelay.toFixed(1)} + textureVel.w * 6.28;\n\t\t\t\t\t\tfloat lifetime=-sin(x) + 0.5 * sin(2.0 * x);\n\n\t\t\t\t\t\tif(lifetime > 0.0){\n\t\t\t\t\t\t\tvel=normalize(vel) * clamp(length(vel), minCo, maxCo);\n\t\t\t\t\t\t\tpos +=vel * 0.30 * u_speed;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tpos.xyz=textureInitPos.xyz;\n\t\t\t\t\t\t}\n\t\t\t\t\t`))}"lifetime"==i.patternSel?("fadeInOut"==i.lifetimeAlphaChange&&(a=a.replace("//-- Add v_lifetime Here --",`\n\t\t\t\t\tv_lifetime=sin((u_time * ${i.lifeTimeDelay.toFixed(1)}) + vel.w * 6.28);\n\t\t\t\t`)),"fadeIn"==i.lifetimeAlphaChange&&(a=a.replace("//-- Add v_lifetime Here --",`\n\t\t\t\t\tfloat x=u_time * ${i.lifeTimeDelay.toFixed(1)} + vel.w * 6.28;\n\t\t\t\t\tv_lifetime=sin(x)- 0.5 * sin(2.0 * x);\n\t\t\t\t`)),"fadeOut"==i.lifetimeAlphaChange&&(a=a.replace("//-- Add v_lifetime Here --",`\n\t\t\t\t\tfloat x=u_time * ${i.lifeTimeDelay.toFixed(1)} + vel.w * 6.28;\n\t\t\t\t\tv_lifetime=-sin(x) + 0.5 * sin(2.0 * x);\n\t\t\t\t`))):a=a.replace("//-- Add v_lifetime Here --","\n\t\t\t\tv_lifetime=vel.w;\n\t\t\t")}(this),function(t){for(var e=t.settings,i=new THREE.BufferGeometry,n=new Float32Array(3*t.count),r=new Float32Array(2*t.count),s=0,l=0;l=2?(o>=0&&o<1/l*a&&s.add(new THREE.Vector3(e.settings.sIX,e.settings.sIY,e.settings.sIZ)),o>=1/l*a&&o<2/l*a&&s.add(new THREE.Vector3(-e.settings.sIX,-e.settings.sIY,e.settings.sIZ)),l>=4&&(o>=2/l*a&&o<3/l*a&&s.add(new THREE.Vector3(-e.settings.sIX,e.settings.sIY,e.settings.sIZ)),o>=3/l*a&&o<4/l*a&&s.add(new THREE.Vector3(e.settings.sIX,-e.settings.sIY,e.settings.sIZ)),l>=6&&(o>=4/l*a&&o<5/l*a&&s.add(new THREE.Vector3(0,0,.5*e.settings.sIZ)),o>=5/l*a&&o<6/l*a&&s.add(new THREE.Vector3(0,0,1.5*e.settings.sIZ))))):s.add(new THREE.Vector3(e.settings.sIX,e.settings.sIY,e.settings.sIZ)),i[n+0]=s.x,i[n+1]=s.y,i[n+2]=s.z,i[n+3]=Math.random()}}(a.renderTexturePos,t);break;case"inGlobe":!function(t,e){for(var i=t.image.data,n=0,r=i.length;n=2?(o>=0&&o<1/l*a&&s.add(new THREE.Vector3(e.settings.sIX,e.settings.sIY,e.settings.sIZ)),o>=1/l*a&&o<2/l*a&&s.add(new THREE.Vector3(-e.settings.sIX,-e.settings.sIY,e.settings.sIZ)),l>=4&&(o>=2/l*a&&o<3/l*a&&s.add(new THREE.Vector3(-e.settings.sIX,e.settings.sIY,e.settings.sIZ)),o>=3/l*a&&o<4/l*a&&s.add(new THREE.Vector3(e.settings.sIX,-e.settings.sIY,e.settings.sIZ)),l>=6&&(o>=4/l*a&&o<5/l*a&&s.add(new THREE.Vector3(0,0,.5*e.settings.sIZ)),o>=5/l*a&&o<6/l*a&&s.add(new THREE.Vector3(0,0,1.5*e.settings.sIZ))))):s.add(new THREE.Vector3(e.settings.sIX,e.settings.sIY,e.settings.sIZ)),i[n+0]=s.x,i[n+1]=s.y,i[n+2]=s.z,i[n+3]=Math.random()}}(a.renderTexturePos,t);break;case"onBorder":!function(t,e){for(var i=g(e),n=t.image.data,r=0,s=n.length;r=.5)var a=new THREE.Vector3(Math.random()*i.x-i.x/2,-i.y/2+Math.round(Math.random())*i.y,10*Math.random()-5);else a=new THREE.Vector3(-i.x/2+Math.round(Math.random())*i.x,Math.random()*i.y-i.y/2,10*Math.random()-5);n[r+0]=a.x,n[r+1]=a.y,n[r+2]=a.z,n[r+3]=Math.random()}}(a.renderTexturePos,t);break;case"random":!function(t,e){for(var i=g(e),n=t.image.data,r=0,s=n.length;r=2&&(r=4&&(r>n.length/4&&rn.length/2&&r<3*n.length/4&&a.set(Math.random()*i.x-i.x/2+e.settings.sIX,e.settings.sIY,-e.settings.sIZ))),n[r+0]=a.x,n[r+1]=a.y,n[r+2]=a.z,n[r+3]=Math.random()}}(a.renderTexturePos,t);break;case"inCircle":!function(t,e){for(var i=t.image.data,n=0,r=i.length;n=2?(o>=0&&o<1/l*a&&s.add(new THREE.Vector3(e.settings.sIX,e.settings.sIY,e.settings.sIZ)),o>=1/l*a&&o<2/l*a&&s.add(new THREE.Vector3(-e.settings.sIX,-e.settings.sIY,e.settings.sIZ)),l>=4&&(o>=2/l*a&&o<3/l*a&&s.add(new THREE.Vector3(-e.settings.sIX,e.settings.sIY,e.settings.sIZ)),o>=3/l*a&&o<4/l*a&&s.add(new THREE.Vector3(e.settings.sIX,-e.settings.sIY,e.settings.sIZ)),l>=6&&(o>=4/l*a&&o<5/l*a&&s.add(new THREE.Vector3(0,0,.5*e.settings.sIZ)),o>=5/l*a&&o<6/l*a&&s.add(new THREE.Vector3(0,0,1.5*e.settings.sIZ))))):s.add(new THREE.Vector3(e.settings.sIX,e.settings.sIY,e.settings.sIZ)),i[n+0]=s.x,i[n+1]=s.y,i[n+2]=s.z,i[n+3]=Math.random()}}(a.renderTexturePos,t)}switch(a.spawnAccVec){case"random":!function(t){for(var e=t.image.data,i=0,n=e.length;i1&&(r{this.settings.mouseOnLayer=!0,this.vccToUniform.u_mouseOnLayer.value=this.settings.mouseOnLayer,this.particleMaterial.uniforms.u_mouseOnLayer.value=this.settings.mouseOnLayer})),l.canvas.addEventListener("mouseleave",(t=>{this.settings.mouseOnLayer=!1,this.vccToUniform.u_mouseOnLayer.value=this.settings.mouseOnLayer,this.particleMaterial.uniforms.u_mouseOnLayer.value=this.settings.mouseOnLayer})),l.canvas.addEventListener("mousemove",(t=>{var e=this.settings.canvas.getBoundingClientRect();this.settings.mouseOnLayer=!0,this.settings.mouseVec.x=t.layerX/e.width*2-1,this.settings.mouseVec.y=-t.layerY/e.height*2+1;var i=new THREE.Vector3(this.settings.mouseVec.x,this.settings.mouseVec.y,0);i.unproject(this.camera);var n=i.sub(this.camera.position).normalize(),r=-this.camera.position.z/n.z;l.convertedPos=this.camera.position.clone().add(n.multiplyScalar(r)),l.convertedPos.z=0,this.settings.mouseMoveVec.set(l.convertedPos.x,l.convertedPos.y,0),this.vccToUniform.u_mouseVector.value=[this.settings.mouseMoveVec.x,this.settings.mouseMoveVec.y],this.particleMaterial.uniforms.u_mouseVector.value=[this.settings.mouseMoveVec.x,this.settings.mouseMoveVec.y]}))),"indivRotaWithReturn"===l.gravFollowMouse||"indivRota"===l.gravFollowMouse){var u=document.documentElement.clientWidth,c=document.documentElement.clientHeight,m=[0,0],d=0;document.addEventListener("mousemove",(t=>{if(d>0){var e=t.clientX,i=t.clientY,n=[m[0]-e,m[1]-i],r=n[0]/u*this.settings.gravRotateMouseValue,s=-n[1]/c*this.settings.gravRotateMouseValue;this.scene.rotation.y+=-r*Math.PI/180,this.scene.rotation.x+=s*Math.PI/180,m[0]=e,m[1]=i}else m[0]=t.clientX,m[1]=t.clientY,d++}))}},m.prototype.initPP=function(){var t=_(this);t.theCluster&&"off"!==t.theCluster.vfxSelector&&!this.ppEnabled&&void 0!==this.w&&void 0!==this.h&&0!==this.w&&0!==this.h&&(this.ppEnabled=!1,t.pp=l.postProcessing.d3.init(this.renderer,this.scene,this.camera,{focus:this.settings.focus,aperture:this.settings.aperture,maxblur:this.settings.maxBlur,transparent:!0,width:this.w,height:this.h}))},m.prototype.render=function(e){if(this.destroyed||this.paused||(this.frame=cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(this.bindedRender)),void 0!==e&&void 0!==this.time){this.tDiff=(e-this.time)/1600,this.time=e;var i=_(this);if(void 0!==i.theCluster.lastDim&&i.theCluster.lastDim.width===Math.round(i.eow)&&i.theCluster.lastDim.height===Math.round(i.eoh)||l.theClusterUtils.fitCameraToObject(i),!this.destroyed){this.computeRenderer.compute(),this.particleUniforms.texturePosition.value=this.computeRenderer.getCurrentRenderTarget(this.settings.computePos).texture,this.particleUniforms.textureVelocity.value=this.computeRenderer.getCurrentRenderTarget(this.settings.computeVcc).texture,this.particleUniforms.textureCustomValues.value=this.computeRenderer.getCurrentRenderTarget(this.settings.computeCustomValues).texture,this.particleUniforms.textureInitPos.value=this.computeRenderer.getCurrentRenderTarget(this.settings.computeInitPos).texture,this.particleUniforms.textureInitVCC.value=this.computeRenderer.getCurrentRenderTarget(this.settings.computeInitVCC).texture,0==this.settings.gravPointsVisible&&("off"==this.settings.gravP1MoveSel&&"off"==this.settings.gravP2MoveSel&&"off"==this.settings.gravP3MoveSel||function(t,e){var i=function(t,e){var i=10*Math.sin(t/5e3),n=10*Math.cos(t/5e3);return{x:i,y:n}}(e);t.settings.gravPoint1Toggle&&(t.settings["g1"+t.settings.gravP1MoveSel[0].toUpperCase()]=i.x,t.settings["g1"+t.settings.gravP1MoveSel[1].toUpperCase()]=i.y,t.settings.gravPointArray[0].position[t.settings.gravP1MoveSel[0]]=t.settings["g1"+t.settings.gravP1MoveSel[0].toUpperCase()],t.settings.gravPointArray[0].position[t.settings.gravP1MoveSel[1]]=t.settings["g1"+t.settings.gravP1MoveSel[1].toUpperCase()]);t.settings.gravPoint2Toggle&&(t.settings["g2"+t.settings.gravP2MoveSel[0].toUpperCase()]=i.x,t.settings["g2"+t.settings.gravP2MoveSel[1].toUpperCase()]=i.y,t.settings.gravPointArray[1].position[t.settings.gravP2MoveSel[0]]=t.settings["g2"+t.settings.gravP2MoveSel[0].toUpperCase()],t.settings.gravPointArray[1].position[t.settings.gravP2MoveSel[1]]=t.settings["g2"+t.settings.gravP2MoveSel[1].toUpperCase()]);t.settings.gravPoint3Toggle&&(t.settings["g3"+t.settings.gravP3MoveSel[0].toUpperCase()]=i.x,t.settings["g3"+t.settings.gravP3MoveSel[1].toUpperCase()]=i.y,t.settings.gravPointArray[2].position[t.settings.gravP3MoveSel[0]]=t.settings["g1"+t.settings.gravP3MoveSel[0].toUpperCase()],t.settings.gravPointArray[2].position[t.settings.gravP3MoveSel[1]]=t.settings["g1"+t.settings.gravP3MoveSel[1].toUpperCase()]);d(t.settings),t.vccToUniform.u_gravPositions.value=t.settings.gravPositions}(this,e));var n;t.getElapsedTime()>0&&(this.particleMaterial.uniforms.u_time.value+=this.tDiff,this.posToUniform.u_time.value+=this.tDiff,this.vccToUniform.u_time.value+=this.tDiff,i.pp&&i.pp.composer?("off"!=i.theCluster.vfxSelector&&this.settings.sfxBreathing&&(i.pp.effectPass.uniforms.maxblur.value=tpGS.gsap.utils.mapRange(0,1,this.settings.minBlur,this.settings.maxBlur,Math.abs(Math.sin(Math.PI*(this.particleMaterial.uniforms.u_time.value+.5)*.3)))),i.pp.composer.render()):this.renderer.render(this.scene,this.camera),"off"!=this.settings.animationSel&&((n=this).scene.rotation.x+=n.settings.aniX/1e3*n.settings.speed*1.5,n.scene.rotation.y+=n.settings.aniY/1e3*n.settings.speed*1.5,n.scene.rotation.z+=n.settings.aniZ/1e3*n.settings.speed*1.5),"indivRotaWithReturn"===this.settings.gravFollowMouse&&"off"===this.settings.animationSel&&(this.scene.rotation.y>0&&(this.scene.rotation.y-=this.settings.gravRotateReturnValue),this.scene.rotation.y<0&&(this.scene.rotation.y+=this.settings.gravRotateReturnValue),this.scene.rotation.x>0&&(this.scene.rotation.x-=this.settings.gravRotateReturnValue),this.scene.rotation.x<0&&(this.scene.rotation.x+=this.settings.gravRotateReturnValue)))}}else this.time=e},m.prototype.update=function(){this.particleMaterial.uniforms.u_pointSize.value=this.settings.size,this.particleMaterial.uniforms.u_limitMovementValue.value=this.settings.limitMovementValue,this.particleMaterial.uniforms.u_limitCentrePosition.value=this.settings.limitCentrePosition,this.posToUniform.u_speed.value=this.settings.speed,this.posToUniform.u_lifeTimeDelay.value=this.settings.lifeTimeDelay,this.vccToUniform.u_speed.value=this.settings.speed,this.vccToUniform.u_mass.value=this.settings.mass,this.vccToUniform.u_mass2.value=this.settings.mass2,this.vccToUniform.u_mass3.value=this.settings.mass3,this.vccToUniform.u_gravPositions.value=this.settings.gravPositions,this.vccToUniform.u_lifeTimeDelay.value=this.settings.lifeTimeDelay,this.vccToUniform.u_noiseAmount.value=(this.settings.noiseAmount/100).toFixed(2),this.particleMaterial.uniforms.u_colorImageMixValue.value=this.settings.colorImageMixValue,x(this,this.settings)},m.prototype.resize=function(t,e){this.w=t,this.h=e,this.camera.aspect=this.w/this.h,this.camera.updateProjectionMatrix(),this.renderer&&this.renderer.setSize(this.w,this.h)},m.prototype.destroy=function(){this.destroyed=!0,this.renderer&&(this.renderer.dispose(),this.renderer.domElement.remove(),this.renderer.domElement=null),this.renderer=null,this.frame=cancelAnimationFrame(this.frame)},window.RS_MODULES=window.RS_MODULES||{},window.RS_MODULES.thecluster={loaded:!0,version:"1.0.5"},window.RS_MODULES.checkMinimal&&window.RS_MODULES.checkMinimal()}(); !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).THREE={})}(this,(function(t){"use strict";const e="127",n=100,i=300,r=301,s=302,a=303,o=304,l=306,c=307,h=1e3,u=1001,d=1002,p=1003,f=1004,m=1005,g=1006,v=1007,y=1008,x=1009,_=1012,b=1014,w=1015,M=1016,S=1020,T=1022,E=1023,A=1026,L=1027,R=33776,C=33777,P=33778,D=33779,I=35840,N=35841,B=35842,O=35843,z=37492,F=37496,H=2300,U=2301,G=2302,k=2400,V=2401,W=2402,j=2500,q=2501,X=3e3,Y=3001,Z=3007,J=3002,Q=3004,K=3005,$=3006,tt=7680,et=35044,nt=35048,it="300 es";function rt(){}Object.assign(rt.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}},dispatchEvent:function(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e>8&255]+st[t>>16&255]+st[t>>24&255]+"-"+st[255&e]+st[e>>8&255]+"-"+st[e>>16&15|64]+st[e>>24&255]+"-"+st[63&n|128]+st[n>>8&255]+"-"+st[n>>16&255]+st[n>>24&255]+st[255&i]+st[i>>8&255]+st[i>>16&255]+st[i>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},inverseLerp:function(t,e,n){return t!==e?(n-t)/(e-t):0},lerp:function(t,e,n){return(1-n)*t+n*e},damp:function(t,e,n,i){return ot.lerp(t,e,1-Math.exp(-n*i))},pingpong:function(t,e=1){return e-Math.abs(ot.euclideanModulo(t,2*e)-e)},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){return void 0!==t&&(at=t%2147483647),at=16807*at%2147483647,(at-1)/2147483646},degToRad:function(t){return t*ot.DEG2RAD},radToDeg:function(t){return t*ot.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),c=s((e+i)/2),h=a((e+i)/2),u=s((e-i)/2),d=a((e-i)/2),p=s((i-e)/2),f=a((i-e)/2);switch(r){case"XYX":t.set(o*h,l*u,l*d,o*c);break;case"YZY":t.set(l*d,o*h,l*u,o*c);break;case"ZXZ":t.set(l*u,l*d,o*h,o*c);break;case"XZX":t.set(o*h,l*f,l*p,o*c);break;case"YXY":t.set(l*p,o*h,l*f,o*c);break;case"ZYZ":t.set(l*f,l*p,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};class lt{constructor(t=0,e=0){this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors(a, b) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors(a, b) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*n-s*i+t.x,this.y=r*i+s*n+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}lt.prototype.isVector2=!0;class ct{constructor(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,i,r,s,a,o,l){const c=this.elements;return c[0]=t,c[1]=i,c[2]=a,c[3]=e,c[4]=r,c[5]=o,c[6]=n,c[7]=s,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this}extractBasis(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],c=n[4],h=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],_=i[2],b=i[5],w=i[8];return r[0]=s*f+a*v+o*_,r[3]=s*m+a*y+o*b,r[6]=s*g+a*x+o*w,r[1]=l*f+c*v+h*_,r[4]=l*m+c*y+h*b,r[7]=l*g+c*x+h*w,r[2]=u*f+d*v+p*_,r[5]=u*m+d*y+p*b,r[8]=u*g+d*x+p*w,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8];return e*s*c-e*a*l-n*r*c+n*a*o+i*r*l-i*s*o}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=c*s-a*l,u=a*o-c*r,d=l*r-s*o,p=e*h+n*u+i*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=h*f,t[1]=(i*l-c*n)*f,t[2]=(a*n-i*s)*f,t[3]=u*f,t[4]=(c*e-i*o)*f,t[5]=(i*r-a*e)*f,t[6]=d*f,t[7]=(n*o-l*e)*f,t[8]=(s*e-n*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,n,i,r,s,a){const o=Math.cos(r),l=Math.sin(r);return this.set(n*o,n*l,-n*(o*s+l*a)+s+t,-i*l,i*o,-i*(-l*s+o*a)+a+e,0,0,1),this}scale(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this}rotate(t){const e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],s=i[3],a=i[6],o=i[1],l=i[4],c=i[7];return i[0]=e*r+n*o,i[3]=e*s+n*l,i[6]=e*a+n*c,i[1]=-n*r+e*o,i[4]=-n*s+e*l,i[7]=-n*a+e*c,this}translate(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<9;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}clone(){return(new this.constructor).fromArray(this.elements)}}let ht;ct.prototype.isMatrix3=!0;const ut={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===ht&&(ht=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),ht.width=t.width,ht.height=t.height;const n=ht.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=ht}return e.width>2048||e.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),e.toDataURL("image/jpeg",.6)):e.toDataURL("image/png")}};let dt=0;class pt extends rt{constructor(t=pt.DEFAULT_IMAGE,e=pt.DEFAULT_MAPPING,n=1001,i=1001,r=1006,s=1008,a=1023,o=1009,l=1,c=3e3){super(),Object.defineProperty(this,"id",{value:dt++}),this.uuid=ot.generateUUID(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new lt(0,0),this.repeat=new lt(1,1),this.center=new lt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new ct,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const i=this.image;if(void 0===i.uuid&&(i.uuid=ot.generateUUID()),!e&&void 0===t.images[i.uuid]){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t1)switch(this.wrapS){case h:t.x=t.x-Math.floor(t.x);break;case u:t.x=t.x<0?0:1;break;case d:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case h:t.y=t.y-Math.floor(t.y);break;case u:t.y=t.y<0?0:1;break;case d:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){!0===t&&this.version++}}function ft(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?ut.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}pt.DEFAULT_IMAGE=void 0,pt.DEFAULT_MAPPING=i,pt.prototype.isTexture=!0;class mt{constructor(t=0,e=0,n=0,i=1){this.x=t,this.y=e,this.z=n,this.w=i}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors(a, b) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors(a, b) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*n+s[8]*i+s[12]*r,this.y=s[1]*e+s[5]*n+s[9]*i+s[13]*r,this.z=s[2]*e+s[6]*n+s[10]*i+s[14]*r,this.w=s[3]*e+s[7]*n+s[11]*i+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this}setAxisAngleFromRotationMatrix(t){let e,n,i,r;const s=.01,a=.1,o=t.elements,l=o[0],c=o[4],h=o[8],u=o[1],d=o[5],p=o[9],f=o[2],m=o[6],g=o[10];if(Math.abs(c-u)o&&t>v?tv?o=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),s=Math.atan2(r,e*n);t=Math.sin(t*s)/r,a=Math.sin(a*s)/r}const r=a*n;if(o=o*t+u*r,l=l*t+d*r,c=c*t+p*r,h=h*t+f*r,t===1-a){const t=1/Math.sqrt(o*o+l*l+c*c+h*h);o*=t,l*=t,c*=t,h*=t}}t[e]=o,t[e+1]=l,t[e+2]=c,t[e+3]=h}static multiplyQuaternionsFlat(t,e,n,i,r,s){const a=n[i],o=n[i+1],l=n[i+2],c=n[i+3],h=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=a*p+c*h+o*d-l*u,t[e+1]=o*p+c*u+l*h-a*d,t[e+2]=l*p+c*d+a*u-o*h,t[e+3]=c*p-a*h-o*u-l*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=t._x,i=t._y,r=t._z,s=t._order,a=Math.cos,o=Math.sin,l=a(n/2),c=a(i/2),h=a(r/2),u=o(n/2),d=o(i/2),p=o(r/2);switch(s){case"XYZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"YXZ":this._x=u*c*h+l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"ZXY":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h-u*d*p;break;case"ZYX":this._x=u*c*h-l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h+u*d*p;break;case"YZX":this._x=u*c*h+l*d*p,this._y=l*d*h+u*c*p,this._z=l*c*p-u*d*h,this._w=l*c*h-u*d*p;break;case"XZY":this._x=u*c*h-l*d*p,this._y=l*d*h-u*c*p,this._z=l*c*p+u*d*h,this._w=l*c*h+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(t){const e=t.elements,n=e[0],i=e[4],r=e[8],s=e[1],a=e[5],o=e[9],l=e[2],c=e[6],h=e[10],u=n+a+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(c-o)*t,this._y=(r-l)*t,this._z=(s-i)*t}else if(n>a&&n>h){const t=2*Math.sqrt(1+n-a-h);this._w=(c-o)/t,this._x=.25*t,this._y=(i+s)/t,this._z=(r+l)/t}else if(a>h){const t=2*Math.sqrt(1+a-n-h);this._w=(r-l)/t,this._x=(i+s)/t,this._y=.25*t,this._z=(o+c)/t}else{const t=2*Math.sqrt(1+h-n-a);this._w=(s-i)/t,this._x=(r+l)/t,this._y=(o+c)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let n=t.dot(e)+1;return nMath.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(ot.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions(a, b) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const n=t._x,i=t._y,r=t._z,s=t._w,a=e._x,o=e._y,l=e._z,c=e._w;return this._x=n*c+s*a+i*l-r*o,this._y=i*c+s*o+r*a-n*l,this._z=r*c+s*l+n*o-i*a,this._w=s*c-n*a-i*o-r*l,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,s=this._w;let a=s*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=s,this._x=n,this._y=i,this._z=r,this;const o=1-a*a;if(o<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(o),c=Math.atan2(l,a),h=Math.sin((1-e)*c)/l,u=Math.sin(e*c)/l;return this._w=s*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this}slerpQuaternions(t,e,n){this.copy(t).slerp(e,n)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}yt.prototype.isQuaternion=!0;class xt{constructor(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}set(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors(a, b) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors(a, b) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors(a, b) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(bt.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(bt.setFromAxisAngle(t,e))}applyMatrix3(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,n=this.y,i=this.z,r=t.elements,s=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*s,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*s,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*s,this}applyQuaternion(t){const e=this.x,n=this.y,i=this.z,r=t.x,s=t.y,a=t.z,o=t.w,l=o*e+s*i-a*n,c=o*n+a*e-r*i,h=o*i+r*n-s*e,u=-r*e-s*n-a*i;return this.x=l*o+u*-r+c*-a-h*-s,this.y=c*o+u*-s+h*-r-l*-a,this.z=h*o+u*-a+l*-s-c*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this}clampScalar(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this}lerpVectors(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors(a, b) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const n=t.x,i=t.y,r=t.z,s=e.x,a=e.y,o=e.z;return this.x=i*o-r*a,this.y=r*s-n*o,this.z=n*a-i*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)}projectOnPlane(t){return _t.copy(this).projectOnVector(t),this.sub(_t)}reflect(t){return this.sub(_t.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(ot.clamp(n,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this}setFromMatrixColumn(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}xt.prototype.isVector3=!0;const _t=new xt,bt=new yt;class wt{constructor(t=new xt(1/0,1/0,1/0),e=new xt(-1/0,-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,a=-1/0;for(let o=0,l=t.length;or&&(r=l),c>s&&(s=c),h>a&&(a=h)}return this.min.set(e,n,i),this.max.set(r,s,a),this}setFromBufferAttribute(t){let e=1/0,n=1/0,i=1/0,r=-1/0,s=-1/0,a=-1/0;for(let o=0,l=t.count;or&&(r=l),c>s&&(s=c),h>a&&(a=h)}return this.min.set(e,n,i),this.max.set(r,s,a),this}setFromPoints(t){this.makeEmpty();for(let e=0,n=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new xt),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,St),St.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Dt),It.subVectors(this.max,Dt),Et.subVectors(t.a,Dt),At.subVectors(t.b,Dt),Lt.subVectors(t.c,Dt),Rt.subVectors(At,Et),Ct.subVectors(Lt,At),Pt.subVectors(Et,Lt);let e=[0,-Rt.z,Rt.y,0,-Ct.z,Ct.y,0,-Pt.z,Pt.y,Rt.z,0,-Rt.x,Ct.z,0,-Ct.x,Pt.z,0,-Pt.x,-Rt.y,Rt.x,0,-Ct.y,Ct.x,0,-Pt.y,Pt.x,0];return!!Ot(e,Et,At,Lt,It)&&(e=[1,0,0,0,1,0,0,0,1],!!Ot(e,Et,At,Lt,It)&&(Nt.crossVectors(Rt,Ct),e=[Nt.x,Nt.y,Nt.z],Ot(e,Et,At,Lt,It)))}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new xt),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return St.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(St).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(Mt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Mt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Mt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Mt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Mt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Mt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Mt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Mt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Mt)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}wt.prototype.isBox3=!0;const Mt=[new xt,new xt,new xt,new xt,new xt,new xt,new xt,new xt],St=new xt,Tt=new wt,Et=new xt,At=new xt,Lt=new xt,Rt=new xt,Ct=new xt,Pt=new xt,Dt=new xt,It=new xt,Nt=new xt,Bt=new xt;function Ot(t,e,n,i,r){for(let s=0,a=t.length-3;s<=a;s+=3){Bt.fromArray(t,s);const a=r.x*Math.abs(Bt.x)+r.y*Math.abs(Bt.y)+r.z*Math.abs(Bt.z),o=e.dot(Bt),l=n.dot(Bt),c=i.dot(Bt);if(Math.max(-Math.max(o,l,c),Math.min(o,l,c))>a)return!1}return!0}const zt=new wt,Ft=new xt,Ht=new xt,Ut=new xt;class Gt{constructor(t=new xt,e=-1){this.center=t,this.radius=e}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const n=this.center;void 0!==e?n.copy(e):zt.setFromPoints(t).getCenter(n);let i=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new wt),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){Ut.subVectors(t,this.center);const e=Ut.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),n=.5*(t-this.radius);this.center.add(Ut.multiplyScalar(n/t)),this.radius+=n}return this}union(t){return Ht.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(Ft.copy(t.center).add(Ht)),this.expandByPoint(Ft.copy(t.center).sub(Ht)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const kt=new xt,Vt=new xt,Wt=new xt,jt=new xt,qt=new xt,Xt=new xt,Yt=new xt;class Zt{constructor(t=new xt,e=new xt(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new xt),e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,kt)),this}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new xt),e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=kt.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(kt.copy(this.direction).multiplyScalar(e).add(this.origin),kt.distanceToSquared(t))}distanceSqToSegment(t,e,n,i){Vt.copy(t).add(e).multiplyScalar(.5),Wt.copy(e).sub(t).normalize(),jt.copy(this.origin).sub(Vt);const r=.5*t.distanceTo(e),s=-this.direction.dot(Wt),a=jt.dot(this.direction),o=-jt.dot(Wt),l=jt.lengthSq(),c=Math.abs(1-s*s);let h,u,d,p;if(c>0)if(h=s*o-a,u=s*a-o,p=r*c,h>=0)if(u>=-p)if(u<=p){const t=1/c;h*=t,u*=t,d=h*(h+s*u+2*a)+u*(s*h+u+2*o)+l}else u=r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u=-r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;else u<=-p?(h=Math.max(0,-(-s*r+a)),u=h>0?-r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l):u<=p?(h=0,u=Math.min(Math.max(-r,-o),r),d=u*(u+2*o)+l):(h=Math.max(0,-(s*r+a)),u=h>0?r:Math.min(Math.max(-r,-o),r),d=-h*h+u*(u+2*o)+l);else u=s>0?-r:r,h=Math.max(0,-(s*u+a)),d=-h*h+u*(u+2*o)+l;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(Wt).multiplyScalar(u).add(Vt),d}intersectSphere(t,e){kt.subVectors(t.center,this.origin);const n=kt.dot(this.direction),i=kt.dot(kt)-n*n,r=t.radius*t.radius;if(i>r)return null;const s=Math.sqrt(r-i),a=n-s,o=n+s;return a<0&&o<0?null:a<0?this.at(o,e):this.at(a,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null}intersectPlane(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let n,i,r,s,a,o;const l=1/this.direction.x,c=1/this.direction.y,h=1/this.direction.z,u=this.origin;return l>=0?(n=(t.min.x-u.x)*l,i=(t.max.x-u.x)*l):(n=(t.max.x-u.x)*l,i=(t.min.x-u.x)*l),c>=0?(r=(t.min.y-u.y)*c,s=(t.max.y-u.y)*c):(r=(t.max.y-u.y)*c,s=(t.min.y-u.y)*c),n>s||r>i?null:((r>n||n!=n)&&(n=r),(s=0?(a=(t.min.z-u.z)*h,o=(t.max.z-u.z)*h):(a=(t.max.z-u.z)*h,o=(t.min.z-u.z)*h),n>o||a>i?null:((a>n||n!=n)&&(n=a),(o=0?n:i,e)))}intersectsBox(t){return null!==this.intersectBox(t,kt)}intersectTriangle(t,e,n,i,r){qt.subVectors(e,t),Xt.subVectors(n,t),Yt.crossVectors(qt,Xt);let s,a=this.direction.dot(Yt);if(a>0){if(i)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}jt.subVectors(this.origin,t);const o=s*this.direction.dot(Xt.crossVectors(jt,Xt));if(o<0)return null;const l=s*this.direction.dot(qt.cross(jt));if(l<0)return null;if(o+l>a)return null;const c=-s*jt.dot(Yt);return c<0?null:this.at(c/a,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class Jt{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,n,i,r,s,a,o,l,c,h,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=s,g[9]=a,g[13]=o,g[2]=l,g[6]=c,g[10]=h,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Jt).fromArray(this.elements)}copy(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this}copyPosition(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this}extractRotation(t){const e=this.elements,n=t.elements,i=1/Qt.setFromMatrixColumn(t,0).length(),r=1/Qt.setFromMatrixColumn(t,1).length(),s=1/Qt.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*s,e[9]=n[9]*s,e[10]=n[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,n=t.x,i=t.y,r=t.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(i),l=Math.sin(i),c=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=-o*h,e[8]=l,e[1]=n+i*l,e[5]=t-r*l,e[9]=-a*o,e[2]=r-t*l,e[6]=i+n*l,e[10]=s*o}else if("YXZ"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t+r*a,e[4]=i*a-n,e[8]=s*l,e[1]=s*h,e[5]=s*c,e[9]=-a,e[2]=n*a-i,e[6]=r+t*a,e[10]=s*o}else if("ZXY"===t.order){const t=o*c,n=o*h,i=l*c,r=l*h;e[0]=t-r*a,e[4]=-s*h,e[8]=i+n*a,e[1]=n+i*a,e[5]=s*c,e[9]=r-t*a,e[2]=-s*l,e[6]=a,e[10]=s*o}else if("ZYX"===t.order){const t=s*c,n=s*h,i=a*c,r=a*h;e[0]=o*c,e[4]=i*l-n,e[8]=t*l+r,e[1]=o*h,e[5]=r*l+t,e[9]=n*l-i,e[2]=-l,e[6]=a*o,e[10]=s*o}else if("YZX"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=s*c,e[9]=-a*c,e[2]=-l*c,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=s*o,n=s*l,i=a*o,r=a*l;e[0]=o*c,e[4]=-h,e[8]=l*c,e[1]=t*h+r,e[5]=s*c,e[9]=n*h-i,e[2]=i*h-n,e[6]=a*c,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose($t,t,te)}lookAt(t,e,n){const i=this.elements;return ie.subVectors(t,e),0===ie.lengthSq()&&(ie.z=1),ie.normalize(),ee.crossVectors(n,ie),0===ee.lengthSq()&&(1===Math.abs(n.z)?ie.x+=1e-4:ie.z+=1e-4,ie.normalize(),ee.crossVectors(n,ie)),ee.normalize(),ne.crossVectors(ie,ee),i[0]=ee.x,i[4]=ne.x,i[8]=ie.x,i[1]=ee.y,i[5]=ne.y,i[9]=ie.y,i[2]=ee.z,i[6]=ne.z,i[10]=ie.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices(a, b) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const n=t.elements,i=e.elements,r=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],c=n[1],h=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=i[0],w=i[4],M=i[8],S=i[12],T=i[1],E=i[5],A=i[9],L=i[13],R=i[2],C=i[6],P=i[10],D=i[14],I=i[3],N=i[7],B=i[11],O=i[15];return r[0]=s*b+a*T+o*R+l*I,r[4]=s*w+a*E+o*C+l*N,r[8]=s*M+a*A+o*P+l*B,r[12]=s*S+a*L+o*D+l*O,r[1]=c*b+h*T+u*R+d*I,r[5]=c*w+h*E+u*C+d*N,r[9]=c*M+h*A+u*P+d*B,r[13]=c*S+h*L+u*D+d*O,r[2]=p*b+f*T+m*R+g*I,r[6]=p*w+f*E+m*C+g*N,r[10]=p*M+f*A+m*P+g*B,r[14]=p*S+f*L+m*D+g*O,r[3]=v*b+y*T+x*R+_*I,r[7]=v*w+y*E+x*C+_*N,r[11]=v*M+y*A+x*P+_*B,r[15]=v*S+y*L+x*D+_*O,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this}determinant(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],s=t[1],a=t[5],o=t[9],l=t[13],c=t[2],h=t[6],u=t[10],d=t[14];return t[3]*(+r*o*h-i*l*h-r*a*u+n*l*u+i*a*d-n*o*d)+t[7]*(+e*o*d-e*l*u+r*s*u-i*s*d+i*l*c-r*o*c)+t[11]*(+e*l*h-e*a*d-r*s*h+n*s*d+r*a*c-n*l*c)+t[15]*(-i*a*c-e*o*h+e*a*u+i*s*h-n*s*u+n*o*c)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this}invert(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],s=t[4],a=t[5],o=t[6],l=t[7],c=t[8],h=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=h*m*l-f*u*l+f*o*d-a*m*d-h*o*g+a*u*g,y=p*u*l-c*m*l-p*o*d+s*m*d+c*o*g-s*u*g,x=c*f*l-p*h*l+p*a*d-s*f*d-c*a*g+s*h*g,_=p*h*o-c*f*o-p*a*u+s*f*u+c*a*m-s*h*m,b=e*v+n*y+i*x+r*_;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/b;return t[0]=v*w,t[1]=(f*u*r-h*m*r-f*i*d+n*m*d+h*i*g-n*u*g)*w,t[2]=(a*m*r-f*o*r+f*i*l-n*m*l-a*i*g+n*o*g)*w,t[3]=(h*o*r-a*u*r-h*i*l+n*u*l+a*i*d-n*o*d)*w,t[4]=y*w,t[5]=(c*m*r-p*u*r+p*i*d-e*m*d-c*i*g+e*u*g)*w,t[6]=(p*o*r-s*m*r-p*i*l+e*m*l+s*i*g-e*o*g)*w,t[7]=(s*u*r-c*o*r+c*i*l-e*u*l-s*i*d+e*o*d)*w,t[8]=x*w,t[9]=(p*h*r-c*f*r-p*n*d+e*f*d+c*n*g-e*h*g)*w,t[10]=(s*f*r-p*a*r+p*n*l-e*f*l-s*n*g+e*a*g)*w,t[11]=(c*a*r-s*h*r-c*n*l+e*h*l+s*n*d-e*a*d)*w,t[12]=_*w,t[13]=(c*f*i-p*h*i+p*n*u-e*f*u-c*n*m+e*h*m)*w,t[14]=(p*a*i-s*f*i-p*n*o+e*f*o+s*n*m-e*a*m)*w,t[15]=(s*h*i-c*a*i+c*n*o-e*h*o-s*n*u+e*a*u)*w,this}scale(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))}makeTranslation(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,s=t.x,a=t.y,o=t.z,l=r*s,c=r*a;return this.set(l*s+n,l*a-i*o,l*o+i*a,0,l*a+i*o,c*a+n,c*o-i*s,0,l*o-i*a,c*o+i*s,r*o*o+n,0,0,0,0,1),this}makeScale(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this}makeShear(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this}compose(t,e,n){const i=this.elements,r=e._x,s=e._y,a=e._z,o=e._w,l=r+r,c=s+s,h=a+a,u=r*l,d=r*c,p=r*h,f=s*c,m=s*h,g=a*h,v=o*l,y=o*c,x=o*h,_=n.x,b=n.y,w=n.z;return i[0]=(1-(f+g))*_,i[1]=(d+x)*_,i[2]=(p-y)*_,i[3]=0,i[4]=(d-x)*b,i[5]=(1-(u+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(p+y)*w,i[9]=(m-v)*w,i[10]=(1-(u+f))*w,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this}decompose(t,e,n){const i=this.elements;let r=Qt.set(i[0],i[1],i[2]).length();const s=Qt.set(i[4],i[5],i[6]).length(),a=Qt.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Kt.copy(this);const o=1/r,l=1/s,c=1/a;return Kt.elements[0]*=o,Kt.elements[1]*=o,Kt.elements[2]*=o,Kt.elements[4]*=l,Kt.elements[5]*=l,Kt.elements[6]*=l,Kt.elements[8]*=c,Kt.elements[9]*=c,Kt.elements[10]*=c,e.setFromRotationMatrix(Kt),n.x=r,n.y=s,n.z=a,this}makePerspective(t,e,n,i,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const a=this.elements,o=2*r/(e-t),l=2*r/(n-i),c=(e+t)/(e-t),h=(n+i)/(n-i),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return a[0]=o,a[4]=0,a[8]=c,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=u,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this}makeOrthographic(t,e,n,i,r,s){const a=this.elements,o=1/(e-t),l=1/(n-i),c=1/(s-r),h=(e+t)*o,u=(n+i)*l,d=(s+r)*c;return a[0]=2*o,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-u,a[2]=0,a[6]=0,a[10]=-2*c,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this}equals(t){const e=this.elements,n=t.elements;for(let t=0;t<16;t++)if(e[t]!==n[t])return!1;return!0}fromArray(t,e=0){for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this}toArray(t=[],e=0){const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}}Jt.prototype.isMatrix4=!0;const Qt=new xt,Kt=new Jt,$t=new xt(0,0,0),te=new xt(1,1,1),ee=new xt,ne=new xt,ie=new xt,re=new Jt,se=new yt;class ae{constructor(t=0,e=0,n=0,i=ae.DefaultOrder){this._x=t,this._y=e,this._z=n,this._order=i}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e,n){const i=ot.clamp,r=t.elements,s=r[0],a=r[4],o=r[8],l=r[1],c=r[5],h=r[9],u=r[2],d=r[6],p=r[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(i(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-a,s)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,p),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(i(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(i(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(o,p));break;case"XZY":this._z=Math.asin(-i(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(t,e,n){return re.makeRotationFromQuaternion(t),this.setFromRotationMatrix(re,e,n)}setFromVector3(t,e){return this.set(t.x,t.y,t.z,e||this._order)}reorder(t){return se.setFromEuler(this),this.setFromQuaternion(se,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new xt(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}ae.prototype.isEuler=!0,ae.DefaultOrder="XYZ",ae.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class oe{constructor(){this.mask=1}set(t){this.mask=1<1){for(let t=0;t1){for(let t=0;t0){i.children=[];for(let e=0;e0){i.animations=[];for(let e=0;e0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c)}return n.object=i,n;function s(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e1?null:e.copy(n).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new xt),t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const n=e||Se.getNormalMatrix(t),i=this.coplanarPoint(we).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return(new this.constructor).copy(this)}}Te.prototype.isPlane=!0;const Ee=new xt,Ae=new xt,Le=new xt,Re=new xt,Ce=new xt,Pe=new xt,De=new xt,Ie=new xt,Ne=new xt,Be=new xt;class Oe{constructor(t=new xt,e=new xt,n=new xt){this.a=t,this.b=e,this.c=n}static getNormal(t,e,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new xt),i.subVectors(n,e),Ee.subVectors(t,e),i.cross(Ee);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(t,e,n,i,r){Ee.subVectors(i,e),Ae.subVectors(n,e),Le.subVectors(t,e);const s=Ee.dot(Ee),a=Ee.dot(Ae),o=Ee.dot(Le),l=Ae.dot(Ae),c=Ae.dot(Le),h=s*l-a*a;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new xt),0===h)return r.set(-2,-1,-1);const u=1/h,d=(l*o-a*c)*u,p=(s*c-a*o)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,n,i){return this.getBarycoord(t,e,n,i,Re),Re.x>=0&&Re.y>=0&&Re.x+Re.y<=1}static getUV(t,e,n,i,r,s,a,o){return this.getBarycoord(t,e,n,i,Re),o.set(0,0),o.addScaledVector(r,Re.x),o.addScaledVector(s,Re.y),o.addScaledVector(a,Re.z),o}static isFrontFacing(t,e,n,i){return Ee.subVectors(n,e),Ae.subVectors(t,e),Ee.cross(Ae).dot(i)<0}set(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this}setFromPointsAndIndices(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Ee.subVectors(this.c,this.b),Ae.subVectors(this.a,this.b),.5*Ee.cross(Ae).length()}getMidpoint(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new xt),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return Oe.getNormal(this.a,this.b,this.c,t)}getPlane(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Te),t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return Oe.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,n,i,r){return Oe.getUV(t,this.a,this.b,this.c,e,n,i,r)}containsPoint(t){return Oe.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return Oe.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new xt);const n=this.a,i=this.b,r=this.c;let s,a;Ce.subVectors(i,n),Pe.subVectors(r,n),Ie.subVectors(t,n);const o=Ce.dot(Ie),l=Pe.dot(Ie);if(o<=0&&l<=0)return e.copy(n);Ne.subVectors(t,i);const c=Ce.dot(Ne),h=Pe.dot(Ne);if(c>=0&&h<=c)return e.copy(i);const u=o*h-c*l;if(u<=0&&o>=0&&c<=0)return s=o/(o-c),e.copy(n).addScaledVector(Ce,s);Be.subVectors(t,r);const d=Ce.dot(Be),p=Pe.dot(Be);if(p>=0&&d<=p)return e.copy(r);const f=d*l-o*p;if(f<=0&&l>=0&&p<=0)return a=l/(l-p),e.copy(n).addScaledVector(Pe,a);const m=c*p-d*h;if(m<=0&&h-c>=0&&d-p>=0)return De.subVectors(r,i),a=(h-c)/(h-c+(d-p)),e.copy(i).addScaledVector(De,a);const g=1/(m+f+u);return s=f*g,a=u*g,e.copy(n).addScaledVector(Ce,s).addScaledVector(Pe,a)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let ze=0;function Fe(){Object.defineProperty(this,"id",{value:ze++}),this.uuid=ot.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=n,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=tt,this.stencilZFail=tt,this.stencilZPass=tt,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}Fe.prototype=Object.assign(Object.create(rt.prototype),{constructor:Fe,isMaterial:!0,onBeforeCompile:function(){},customProgramCacheKey:function(){return this.onBeforeCompile.toString()},setValues:function(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if("shading"===e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}},toJSON:function(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(n.alphaToCoverage=this.alphaToCoverage),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!0===this.flatShading&&(n.flatShading=this.flatShading),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Fe.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});const He={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ue={h:0,s:0,l:0},Ge={h:0,s:0,l:0};function ke(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function Ve(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function We(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class je{constructor(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,n){return this.r=t,this.g=e,this.b=n,this}setHSL(t,e,n){if(t=ot.euclideanModulo(t,1),e=ot.clamp(e,0,1),n=ot.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=ke(r,i,t+1/3),this.g=ke(r,i,t),this.b=ke(r,i,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const i=n[1],r=n[2];switch(i){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const n=parseFloat(t[1])/360,i=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(n,i,r)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=He[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=Ve(t.r),this.g=Ve(t.g),this.b=Ve(t.b),this}copyLinearToSRGB(t){return this.r=We(t.r),this.g=We(t.g),this.b=We(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});const e=this.r,n=this.g,i=this.b,r=Math.max(e,n,i),s=Math.min(e,n,i);let a,o;const l=(s+r)/2;if(s===r)a=0,o=0;else{const t=r-s;switch(o=l<=.5?t/(r+s):t/(2-r-s),r){case e:a=(n-i)/t+(ne&&(e=t[n]);return e}Object.defineProperty(Ze.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Ze.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i65535?nn:tn)(t,1):this.index=t,this},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},hasAttribute:function(t){return void 0!==this.attributes[t]},addGroup:function(t,e,n=0){this.groups.push({start:t,count:e,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new ct).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return un.makeRotationX(t),this.applyMatrix4(un),this},rotateY:function(t){return un.makeRotationY(t),this.applyMatrix4(un),this},rotateZ:function(t){return un.makeRotationZ(t),this.applyMatrix4(un),this},translate:function(t,e,n){return un.makeTranslation(t,e,n),this.applyMatrix4(un),this},scale:function(t,e,n){return un.makeScale(t,e,n),this.applyMatrix4(un),this},lookAt:function(t){return dn.lookAt(t),dn.updateMatrix(),this.applyMatrix4(dn.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(pn).negate(),this.translate(pn.x,pn.y,pn.z),this},setFromPoints:function(t){const e=[];for(let n=0,i=t.length;n0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const e in n){const i=n[e];t.data.attributes[e]=i.toJSON(t.data)}const i={};let r=!1;for(const e in this.morphAttributes){const n=this.morphAttributes[e],s=[];for(let e=0,i=n.length;e0&&(i[e]=s,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(t.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),t},clone:function(){return(new vn).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const t in i){const n=i[t];this.setAttribute(t,n.clone(e))}const r=t.morphAttributes;for(const t in r){const n=[],i=r[t];for(let t=0,r=i.length;tn.far?null:{distance:c,point:Nn.clone(),object:t}}(t,e,n,i,bn,wn,Mn,In);if(p){o&&(Cn.fromBufferAttribute(o,c),Pn.fromBufferAttribute(o,h),Dn.fromBufferAttribute(o,u),p.uv=Oe.getUV(In,bn,wn,Mn,Cn,Pn,Dn,new lt)),l&&(Cn.fromBufferAttribute(l,c),Pn.fromBufferAttribute(l,h),Dn.fromBufferAttribute(l,u),p.uv2=Oe.getUV(In,bn,wn,Mn,Cn,Pn,Dn,new lt));const t={a:c,b:h,c:u,normal:new xt,materialIndex:0};Oe.getNormal(bn,wn,Mn,t.normal),p.face=t}return p}Bn.prototype=Object.assign(Object.create(be.prototype),{constructor:Bn,isMesh:!0,copy:function(t){return be.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0===i)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),_n.copy(n.boundingSphere),_n.applyMatrix4(r),!1===t.ray.intersectsSphere(_n))return;if(yn.copy(r).invert(),xn.copy(t.ray).applyMatrix4(yn),null!==n.boundingBox&&!1===xn.intersectsBox(n.boundingBox))return;let s;if(n.isBufferGeometry){const r=n.index,a=n.attributes.position,o=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,h=n.attributes.uv2,u=n.groups,d=n.drawRange;if(null!==r)if(Array.isArray(i))for(let n=0,p=u.length;n0?1:-1,c.push(A.x,A.y,A.z),h.push(o/m),h.push(1-s/g),T+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const n={};for(const t in this.extensions)!0===this.extensions[t]&&(n[t]=!0);return Object.keys(n).length>0&&(e.extensions=n),e},kn.prototype=Object.assign(Object.create(be.prototype),{constructor:kn,isCamera:!0,copy:function(t,e){return be.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new xt),this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){be.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(t,e){be.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),Vn.prototype=Object.assign(Object.create(kn.prototype),{constructor:Vn,isPerspectiveCamera:!0,copy:function(t,e){return kn.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){const e=.5*this.getFilmHeight()/t;this.fov=2*ot.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){const t=Math.tan(.5*ot.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*ot.RAD2DEG*Math.atan(Math.tan(.5*ot.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,i,r,s){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=s,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const t=this.near;let e=t*Math.tan(.5*ot.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,a=s.fullHeight;r+=s.offsetX*i/t,e-=s.offsetY*n/a,i*=s.width/t,n*=s.height/a}const a=this.filmOffset;0!==a&&(r+=t*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(t){const e=be.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});const Wn=90;class jn extends be{constructor(t,e,n){if(super(),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const i=new Vn(Wn,1,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new xt(1,0,0)),this.add(i);const r=new Vn(Wn,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new xt(-1,0,0)),this.add(r);const s=new Vn(Wn,1,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new xt(0,1,0)),this.add(s);const a=new Vn(Wn,1,t,e);a.layers=this.layers,a.up.set(0,0,-1),a.lookAt(new xt(0,-1,0)),this.add(a);const o=new Vn(Wn,1,t,e);o.layers=this.layers,o.up.set(0,-1,0),o.lookAt(new xt(0,0,1)),this.add(o);const l=new Vn(Wn,1,t,e);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new xt(0,0,-1)),this.add(l)}update(t,e){null===this.parent&&this.updateMatrixWorld();const n=this.renderTarget,[i,r,s,a,o,l]=this.children,c=t.xr.enabled,h=t.getRenderTarget();t.xr.enabled=!1;const u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,s),t.setRenderTarget(n,3),t.render(e,a),t.setRenderTarget(n,4),t.render(e,o),n.texture.generateMipmaps=u,t.setRenderTarget(n,5),t.render(e,l),t.setRenderTarget(h),t.xr.enabled=c}}class qn extends pt{constructor(t,e,n,i,s,a,o,l,c,h){super(t=void 0!==t?t:[],e=void 0!==e?e:r,n,i,s,a,o=void 0!==o?o:T,l,c,h),this._needsFlipEnvMap=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}qn.prototype.isCubeTexture=!0;class Xn extends gt{constructor(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget(size, options)"),e=n),super(t,t,e),e=e||{},this.texture=new qn(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:g,this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=E,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection(in vec3 dir, in mat4 matrix){\n\n\t\t\t\t\treturn normalize(( matrix * vec4(dir, 0.0)).xyz);\n\n\t\t\t\t}\n\n\t\t\t\tvoid main(){\n\n\t\t\t\t\tvWorldDirection=transformDirection(position, modelMatrix);\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main(){\n\n\t\t\t\t\tvec3 direction=normalize(vWorldDirection);\n\n\t\t\t\t\tvec2 sampleUV=equirectUv(direction);\n\n\t\t\t\t\tgl_FragColor=texture2D(tEquirect, sampleUV);\n\n\t\t\t\t}\n\t\t\t"},i=new zn(5,5,5),r=new Gn({name:"CubemapFromEquirect",uniforms:Fn(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});r.uniforms.tEquirect.value=e;const s=new Bn(i,r),a=e.minFilter;e.minFilter===y&&(e.minFilter=g);return new jn(1,10,this).update(t,s),e.minFilter=a,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,n,i){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,n,i);t.setRenderTarget(r)}}Xn.prototype.isWebGLCubeRenderTarget=!0;class Yn extends pt{constructor(t,e,n,i,r,s,a,o,l,c,h,u){super(null,s,a,o,l,c,i,r,h,u),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==l?l:p,this.minFilter=void 0!==c?c:p,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}}Yn.prototype.isDataTexture=!0;const Zn=new Gt,Jn=new xt;class Qn{constructor(t=new Te,e=new Te,n=new Te,i=new Te,r=new Te,s=new Te){this.planes=[t,e,n,i,r,s]}set(t,e,n,i,r,s){const a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(s),this}copy(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this}setFromProjectionMatrix(t){const e=this.planes,n=t.elements,i=n[0],r=n[1],s=n[2],a=n[3],o=n[4],l=n[5],c=n[6],h=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(a-i,h-o,f-u,y-m).normalize(),e[1].setComponents(a+i,h+o,f+u,y+m).normalize(),e[2].setComponents(a+r,h+l,f+d,y+g).normalize(),e[3].setComponents(a-r,h-l,f-d,y-g).normalize(),e[4].setComponents(a-s,h-c,f-p,y-v).normalize(),e[5].setComponents(a+s,h+c,f+p,y+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Zn.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Zn)}intersectsSprite(t){return Zn.center.set(0,0,0),Zn.radius=.7071067811865476,Zn.applyMatrix4(t.matrixWorld),this.intersectsSphere(Zn)}intersectsSphere(t){const e=this.planes,n=t.center,i=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(n)0?t.max.x:t.min.x,Jn.y=i.normal.y>0?t.max.y:t.min.y,Jn.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Jn)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}function Kn(){let t=null,e=!1,n=null,i=null;function r(e,s){n(e,s),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function $n(t,e){const n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=i.get(e);return void((!t||t.version 0.0){\n\t\tdistanceFalloff *=pow2(saturate(1.0 - pow4(lightDistance / cutoffDistance)));\n\t}\n\treturn distanceFalloff;\n#else\n\tif(cutoffDistance > 0.0&&decayExponent > 0.0){\n\t\treturn pow(saturate(-lightDistance / cutoffDistance + 1.0), decayExponent);\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert(const in vec3 diffuseColor){\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick(const in vec3 specularColor, const in float dotLH){\n\tfloat fresnel=exp2(( -5.55473 * dotLH - 6.98316) * dotLH);\n\treturn(1.0 - specularColor) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent(const in vec3 F0, const in float dotNV, const in float roughness){\n\tfloat fresnel=exp2(( -5.55473 * dotNV - 6.98316) * dotNV);\n\tvec3 Fr=max(vec3(1.0 - roughness), F0) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith(const in float alpha, const in float dotNL, const in float dotNV){\n\tfloat a2=pow2(alpha);\n\tfloat gl=dotNL + sqrt(a2 +(1.0 - a2) * pow2(dotNL));\n\tfloat gv=dotNV + sqrt(a2 +(1.0 - a2) * pow2(dotNV));\n\treturn 1.0 /(gl * gv);\n}\nfloat G_GGX_SmithCorrelated(const in float alpha, const in float dotNL, const in float dotNV){\n\tfloat a2=pow2(alpha);\n\tfloat gv=dotNL * sqrt(a2 +(1.0 - a2) * pow2(dotNV));\n\tfloat gl=dotNV * sqrt(a2 +(1.0 - a2) * pow2(dotNL));\n\treturn 0.5 / max(gv + gl, EPSILON);\n}\nfloat D_GGX(const in float alpha, const in float dotNH){\n\tfloat a2=pow2(alpha);\n\tfloat denom=pow2(dotNH) *(a2 - 1.0) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2(denom);\n}\nvec3 BRDF_Specular_GGX(const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness){\n\tfloat alpha=pow2(roughness);\n\tvec3 halfDir=normalize(incidentLight.direction + viewDir);\n\tfloat dotNL=saturate(dot(normal, incidentLight.direction));\n\tfloat dotNV=saturate(dot(normal, viewDir));\n\tfloat dotNH=saturate(dot(normal, halfDir));\n\tfloat dotLH=saturate(dot(incidentLight.direction, halfDir));\n\tvec3 F=F_Schlick(specularColor, dotLH);\n\tfloat G=G_GGX_SmithCorrelated(alpha, dotNL, dotNV);\n\tfloat D=D_GGX(alpha, dotNH);\n\treturn F *(G * D);\n}\nvec2 LTC_Uv(const in vec3 N, const in vec3 V, const in float roughness){\n\tconst float LUT_SIZE=64.0;\n\tconst float LUT_SCALE=(LUT_SIZE - 1.0) / LUT_SIZE;\n\tconst float LUT_BIAS=0.5 / LUT_SIZE;\n\tfloat dotNV=saturate(dot(N, V));\n\tvec2 uv=vec2(roughness, sqrt(1.0 - dotNV));\n\tuv=uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor(const in vec3 f){\n\tfloat l=length(f);\n\treturn max(( l * l + f.z) /(l + 1.0), 0.0);\n}\nvec3 LTC_EdgeVectorFormFactor(const in vec3 v1, const in vec3 v2){\n\tfloat x=dot(v1, v2);\n\tfloat y=abs(x);\n\tfloat a=0.8543985 +(0.4965155 + 0.0145206 * y) * y;\n\tfloat b=3.4175940 +(4.1616724 + y) * y;\n\tfloat v=a / b;\n\tfloat theta_sintheta=(x > 0.0) ? v:0.5 * inversesqrt(max(1.0 - x * x, 1e-7)) - v;\n\treturn cross(v1, v2) * theta_sintheta;\n}\nvec3 LTC_Evaluate(const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ]){\n\tvec3 v1=rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2=rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal=cross(v1, v2);\n\tif(dot(lightNormal, P - rectCoords[ 0 ]) < 0.0) return vec3(0.0);\n\tvec3 T1, T2;\n\tT1=normalize(V - N * dot(V, N));\n\tT2=- cross(N, T1);\n\tmat3 mat=mInv * transposeMat3(mat3(T1, T2, N));\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ]=mat *(rectCoords[ 0 ] - P);\n\tcoords[ 1 ]=mat *(rectCoords[ 1 ] - P);\n\tcoords[ 2 ]=mat *(rectCoords[ 2 ] - P);\n\tcoords[ 3 ]=mat *(rectCoords[ 3 ] - P);\n\tcoords[ 0 ]=normalize(coords[ 0 ]);\n\tcoords[ 1 ]=normalize(coords[ 1 ]);\n\tcoords[ 2 ]=normalize(coords[ 2 ]);\n\tcoords[ 3 ]=normalize(coords[ 3 ]);\n\tvec3 vectorFormFactor=vec3(0.0);\n\tvectorFormFactor +=LTC_EdgeVectorFormFactor(coords[ 0 ], coords[ 1 ]);\n\tvectorFormFactor +=LTC_EdgeVectorFormFactor(coords[ 1 ], coords[ 2 ]);\n\tvectorFormFactor +=LTC_EdgeVectorFormFactor(coords[ 2 ], coords[ 3 ]);\n\tvectorFormFactor +=LTC_EdgeVectorFormFactor(coords[ 3 ], coords[ 0 ]);\n\tfloat result=LTC_ClippedSphereFormFactor(vectorFormFactor);\n\treturn vec3(result);\n}\nvec3 BRDF_Specular_GGX_Environment(const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness){\n\tfloat dotNV=saturate(dot(normal, viewDir));\n\tvec2 brdf=integrateSpecularBRDF(dotNV, roughness);\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment(const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter){\n\tfloat dotNV=saturate(dot(geometry.normal, geometry.viewDir));\n\tvec3 F=F_Schlick_RoughnessDependent(specularColor, dotNV, roughness);\n\tvec2 brdf=integrateSpecularBRDF(dotNV, roughness);\n\tvec3 FssEss=F * brdf.x + brdf.y;\n\tfloat Ess=brdf.x + brdf.y;\n\tfloat Ems=1.0 - Ess;\n\tvec3 Favg=specularColor +(1.0 - specularColor) * 0.047619;\tvec3 Fms=FssEss * Favg /(1.0 - Ems * Favg);\n\tsingleScatter +=FssEss;\n\tmultiScatter +=Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit(){\n\treturn 0.25;\n}\nfloat D_BlinnPhong(const in float shininess, const in float dotNH){\n\treturn RECIPROCAL_PI *(shininess * 0.5 + 1.0) * pow(dotNH, shininess);\n}\nvec3 BRDF_Specular_BlinnPhong(const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess){\n\tvec3 halfDir=normalize(incidentLight.direction + geometry.viewDir);\n\tfloat dotNH=saturate(dot(geometry.normal, halfDir));\n\tfloat dotLH=saturate(dot(incidentLight.direction, halfDir));\n\tvec3 F=F_Schlick(specularColor, dotLH);\n\tfloat G=G_BlinnPhong_Implicit();\n\tfloat D=D_BlinnPhong(shininess, dotNH);\n\treturn F *(G * D);\n}\nfloat GGXRoughnessToBlinnExponent(const in float ggxRoughness){\n\treturn(2.0 / pow2(ggxRoughness + 0.0001) - 2.0);\n}\nfloat BlinnExponentToGGXRoughness(const in float blinnExponent){\n\treturn sqrt(2.0 /(blinnExponent + 2.0));\n}\n#if defined(USE_SHEEN)\nfloat D_Charlie(float roughness, float NoH){\n\tfloat invAlpha=1.0 / roughness;\n\tfloat cos2h=NoH * NoH;\n\tfloat sin2h=max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL){\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen(const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor){\n\tvec3 N=geometry.normal;\n\tvec3 V=geometry.viewDir;\n\tvec3 H=normalize(V + L);\n\tfloat dotNH=saturate(dot(N, H));\n\treturn specularColor * D_Charlie(roughness, dotNH) * V_Neubelt(dot(N, V), dot(N, L));\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd(){\n\t\tvec2 dSTdx=dFdx(vUv);\n\t\tvec2 dSTdy=dFdy(vUv);\n\t\tfloat Hll=bumpScale * texture2D(bumpMap, vUv).x;\n\t\tfloat dBx=bumpScale * texture2D(bumpMap, vUv + dSTdx).x - Hll;\n\t\tfloat dBy=bumpScale * texture2D(bumpMap, vUv + dSTdy).x - Hll;\n\t\treturn vec2(dBx, dBy);\n\t}\n\tvec3 perturbNormalArb(vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection){\n\t\tvec3 vSigmaX=vec3(dFdx(surf_pos.x), dFdx(surf_pos.y), dFdx(surf_pos.z));\n\t\tvec3 vSigmaY=vec3(dFdy(surf_pos.x), dFdy(surf_pos.y), dFdy(surf_pos.z));\n\t\tvec3 vN=surf_norm;\n\t\tvec3 R1=cross(vSigmaY, vN);\n\t\tvec3 R2=cross(vN, vSigmaX);\n\t\tfloat fDet=dot(vSigmaX, R1) * faceDirection;\n\t\tvec3 vGrad=sign(fDet) *(dHdxy.x * R1 + dHdxy.y * R2);\n\t\treturn normalize(abs(fDet) * surf_norm - vGrad);\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < UNION_CLIPPING_PLANES; i ++){\n\t\tplane=clippingPlanes[ i ];\n\t\tif(dot(vClipPosition, plane.xyz) > plane.w) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped=true;\n\t\t#pragma unroll_loop_start\n\t\tfor(int i=UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++){\n\t\t\tplane=clippingPlanes[ i ];\n\t\t\tclipped=(dot(vClipPosition, plane.xyz) > plane.w)&&clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif(clipped) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition=- mvPosition.xyz;\n#endif",color_fragment:"#if defined(USE_COLOR_ALPHA)\n\tdiffuseColor *=vColor;\n#elif defined(USE_COLOR)\n\tdiffuseColor.rgb *=vColor;\n#endif",color_pars_fragment:"#if defined(USE_COLOR_ALPHA)\n\tvarying vec4 vColor;\n#elif defined(USE_COLOR)\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined(USE_COLOR_ALPHA)\n\tvarying vec4 vColor;\n#elif defined(USE_COLOR)||defined(USE_INSTANCING_COLOR)\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined(USE_COLOR_ALPHA)\n\tvColor=vec4(1.0);\n#elif defined(USE_COLOR)||defined(USE_INSTANCING_COLOR)\n\tvColor=vec3(1.0);\n#endif\n#ifdef USE_COLOR\n\tvColor *=color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *=instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp(a, 0.0, 1.0)\n#endif\n#define whiteComplement(a)(1.0 - saturate(a))\nfloat pow2(const in float x){ return x*x; }\nfloat pow3(const in float x){ return x*x*x; }\nfloat pow4(const in float x){ float x2=x*x; return x2*x2; }\nfloat average(const in vec3 color){ return dot(color, vec3(0.3333)); }\nhighp float rand (const in vec2 uv){\n\tconst highp float a=12.9898, b=78.233, c=43758.5453;\n\thighp float dt=dot(uv.xy, vec2(a,b)), sn=mod(dt, PI);\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength(vec3 v){ return length(v); }\n#else\n\tfloat max3(vec3 v){ return max(max(v.x, v.y), v.z); }\n\tfloat precisionSafeLength(vec3 v){\n\t\tfloat maxComponent=max3(abs(v));\n\t\treturn length(v / maxComponent) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection(in vec3 dir, in mat4 matrix){\n\treturn normalize(( matrix * vec4(dir, 0.0)).xyz);\n}\nvec3 inverseTransformDirection(in vec3 dir, in mat4 matrix){\n\treturn normalize(( vec4(dir, 0.0) * matrix).xyz);\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal){\n\tfloat distance=dot(planeNormal, point - pointOnPlane);\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal){\n\treturn sign(dot(point - pointOnPlane, planeNormal));\n}\nvec3 linePlaneIntersect(in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal){\n\treturn lineDirection *(dot(planeNormal, pointOnPlane - pointOnLine) / dot(planeNormal, lineDirection)) + pointOnLine;\n}\nmat3 transposeMat3(const in mat3 m){\n\tmat3 tmp;\n\ttmp[ 0 ]=vec3(m[ 0 ].x, m[ 1 ].x, m[ 2 ].x);\n\ttmp[ 1 ]=vec3(m[ 0 ].y, m[ 1 ].y, m[ 2 ].y);\n\ttmp[ 2 ]=vec3(m[ 0 ].z, m[ 1 ].z, m[ 2 ].z);\n\treturn tmp;\n}\nfloat linearToRelativeLuminance(const in vec3 color){\n\tvec3 weights=vec3(0.2126, 0.7152, 0.0722);\n\treturn dot(weights, color.rgb);\n}\nbool isPerspectiveMatrix(mat4 m){\n\treturn m[ 2 ][ 3 ]==- 1.0;\n}\nvec2 equirectUv(in vec3 dir){\n\tfloat u=atan(dir.z, dir.x) * RECIPROCAL_PI2 + 0.5;\n\tfloat v=asin(clamp(dir.y, - 1.0, 1.0)) * RECIPROCAL_PI + 0.5;\n\treturn vec2(u, v);\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace(vec3 direction){\n\t\tvec3 absDirection=abs(direction);\n\t\tfloat face=- 1.0;\n\t\tif(absDirection.x > absDirection.z){\n\t\t\tif(absDirection.x > absDirection.y)\n\t\t\t\tface=direction.x > 0.0 ? 0.0:3.0;\n\t\t\telse\n\t\t\t\tface=direction.y > 0.0 ? 1.0:4.0;\n\t\t}else{\n\t\t\tif(absDirection.z > absDirection.y)\n\t\t\t\tface=direction.z > 0.0 ? 2.0:5.0;\n\t\t\telse\n\t\t\t\tface=direction.y > 0.0 ? 1.0:4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV(vec3 direction, float face){\n\t\tvec2 uv;\n\t\tif(face==0.0){\n\t\t\tuv=vec2(direction.z, direction.y) / abs(direction.x);\n\t\t}else if(face==1.0){\n\t\t\tuv=vec2(- direction.x, - direction.z) / abs(direction.y);\n\t\t}else if(face==2.0){\n\t\t\tuv=vec2(- direction.x, direction.y) / abs(direction.z);\n\t\t}else if(face==3.0){\n\t\t\tuv=vec2(- direction.z, direction.y) / abs(direction.x);\n\t\t}else if(face==4.0){\n\t\t\tuv=vec2(- direction.x, direction.z) / abs(direction.y);\n\t\t}else{\n\t\t\tuv=vec2(direction.x, direction.y) / abs(direction.z);\n\t\t}\n\t\treturn 0.5 *(uv + 1.0);\n\t}\n\tvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt){\n\t\tfloat face=getFace(direction);\n\t\tfloat filterInt=max(cubeUV_minMipLevel - mipInt, 0.0);\n\t\tmipInt=max(mipInt, cubeUV_minMipLevel);\n\t\tfloat faceSize=exp2(mipInt);\n\t\tfloat texelSize=1.0 /(3.0 * cubeUV_maxTileSize);\n\t\tvec2 uv=getUV(direction, face) *(faceSize - 1.0);\n\t\tvec2 f=fract(uv);\n\t\tuv +=0.5 - f;\n\t\tif(face > 2.0){\n\t\t\tuv.y +=faceSize;\n\t\t\tface -=3.0;\n\t\t}\n\t\tuv.x +=face * faceSize;\n\t\tif(mipInt < cubeUV_maxMipLevel){\n\t\t\tuv.y +=2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y +=filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x +=3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n\t\tuv *=texelSize;\n\t\tvec3 tl=envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\t\tuv.x +=texelSize;\n\t\tvec3 tr=envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\t\tuv.y +=texelSize;\n\t\tvec3 br=envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\t\tuv.x -=texelSize;\n\t\tvec3 bl=envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\t\tvec3 tm=mix(tl, tr, f.x);\n\t\tvec3 bm=mix(bl, br, f.x);\n\t\treturn mix(tm, bm, f.y);\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip(float roughness){\n\t\tfloat mip=0.0;\n\t\tif(roughness >=r1){\n\t\t\tmip=(r0 - roughness) *(m1 - m0) /(r0 - r1) + m0;\n\t\t}else if(roughness >=r4){\n\t\t\tmip=(r1 - roughness) *(m4 - m1) /(r1 - r4) + m1;\n\t\t}else if(roughness >=r5){\n\t\t\tmip=(r4 - roughness) *(m5 - m4) /(r4 - r5) + m4;\n\t\t}else if(roughness >=r6){\n\t\t\tmip=(r5 - roughness) *(m6 - m5) /(r5 - r6) + m5;\n\t\t}else{\n\t\t\tmip=- 2.0 * log2(1.16 * roughness);\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness){\n\t\tfloat mip=clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n\t\tfloat mipF=fract(mip);\n\t\tfloat mipInt=floor(mip);\n\t\tvec3 color0=bilinearCubeUV(envMap, sampleDir, mipInt);\n\t\tif(mipF==0.0){\n\t\t\treturn vec4(color0, 1.0);\n\t\t}else{\n\t\t\tvec3 color1=bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n\t\t\treturn vec4(mix(color0, color1, mipF), 1.0);\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal=objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m=mat3(instanceMatrix);\n\ttransformedNormal /=vec3(dot(m[ 0 ], m[ 0 ]), dot(m[ 1 ], m[ 1 ]), dot(m[ 2 ], m[ 2 ]));\n\ttransformedNormal=m * transformedNormal;\n#endif\ntransformedNormal=normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal=- transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent=(modelViewMatrix * vec4(objectTangent, 0.0)).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent=- transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed +=normalize(objectNormal) *(texture2D(displacementMap, vUv).x * displacementScale + displacementBias);\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor=texture2D(emissiveMap, vUv);\n\temissiveColor.rgb=emissiveMapTexelToLinear(emissiveColor).rgb;\n\ttotalEmissiveRadiance *=emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor=linearToOutputTexel(gl_FragColor);",encodings_pars_fragment:"\nvec4 LinearToLinear(in vec4 value){\n\treturn value;\n}\nvec4 GammaToLinear(in vec4 value, in float gammaFactor){\n\treturn vec4(pow(value.rgb, vec3(gammaFactor)), value.a);\n}\nvec4 LinearToGamma(in vec4 value, in float gammaFactor){\n\treturn vec4(pow(value.rgb, vec3(1.0 / gammaFactor)), value.a);\n}\nvec4 sRGBToLinear(in vec4 value){\n\treturn vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.a);\n}\nvec4 LinearTosRGB(in vec4 value){\n\treturn vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.a);\n}\nvec4 RGBEToLinear(in vec4 value){\n\treturn vec4(value.rgb * exp2(value.a * 255.0 - 128.0), 1.0);\n}\nvec4 LinearToRGBE(in vec4 value){\n\tfloat maxComponent=max(max(value.r, value.g), value.b);\n\tfloat fExp=clamp(ceil(log2(maxComponent)), -128.0, 127.0);\n\treturn vec4(value.rgb / exp2(fExp),(fExp + 128.0) / 255.0);\n}\nvec4 RGBMToLinear(in vec4 value, in float maxRange){\n\treturn vec4(value.rgb * value.a * maxRange, 1.0);\n}\nvec4 LinearToRGBM(in vec4 value, in float maxRange){\n\tfloat maxRGB=max(value.r, max(value.g, value.b));\n\tfloat M=clamp(maxRGB / maxRange, 0.0, 1.0);\n\tM=ceil(M * 255.0) / 255.0;\n\treturn vec4(value.rgb /(M * maxRange), M);\n}\nvec4 RGBDToLinear(in vec4 value, in float maxRange){\n\treturn vec4(value.rgb *(( maxRange / 255.0) / value.a), 1.0);\n}\nvec4 LinearToRGBD(in vec4 value, in float maxRange){\n\tfloat maxRGB=max(value.r, max(value.g, value.b));\n\tfloat D=max(maxRange / maxRGB, 1.0);\n\tD=clamp(floor(D) / 255.0, 0.0, 1.0);\n\treturn vec4(value.rgb *(D *(255.0 / maxRange)), D);\n}\nconst mat3 cLogLuvM=mat3(0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969);\nvec4 LinearToLogLuv(in vec4 value){\n\tvec3 Xp_Y_XYZp=cLogLuvM * value.rgb;\n\tXp_Y_XYZp=max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy=Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le=2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w=fract(Le);\n\tvResult.z=(Le -(floor(vResult.w * 255.0)) / 255.0) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM=mat3(6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268);\nvec4 LogLuvToLinear(in vec4 value){\n\tfloat Le=value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y=exp2(( Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z=Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x=value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB=cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4(max(vRGB, 0.0), 1.0);\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif(isOrthographic){\n\t\t\tcameraToFrag=normalize(vec3(- viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ]));\n\t\t}else{\n\t\t\tcameraToFrag=normalize(vWorldPosition - cameraPosition);\n\t\t}\n\t\tvec3 worldNormal=inverseTransformDirection(normal, viewMatrix);\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec=reflect(cameraToFrag, worldNormal);\n\t\t#else\n\t\t\tvec3 reflectVec=refract(cameraToFrag, worldNormal, refractionRatio);\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec=vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor=textureCube(envMap, vec3(flipEnvMap * reflectVec.x, reflectVec.yz));\n\t#elif defined(ENVMAP_TYPE_CUBE_UV)\n\t\tvec4 envColor=textureCubeUV(envMap, reflectVec, 0.0);\n\t#else\n\t\tvec4 envColor=vec4(0.0);\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor=envMapTexelToLinear(envColor);\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight=mix(outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity);\n\t#elif defined(ENVMAP_BLENDING_MIX)\n\t\toutgoingLight=mix(outgoingLight, envColor.xyz, specularStrength * reflectivity);\n\t#elif defined(ENVMAP_BLENDING_ADD)\n\t\toutgoingLight +=envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined(USE_BUMPMAP)||defined(USE_NORMALMAP)||defined(PHONG)\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined(USE_BUMPMAP)||defined(USE_NORMALMAP)||defined(PHONG)\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined(USE_ENVMAP)\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance(const in GeometricContext geometry, const in int maxMIPLevel){\n\t\tvec3 worldNormal=inverseTransformDirection(geometry.normal, viewMatrix);\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec=vec3(flipEnvMap * worldNormal.x, worldNormal.yz);\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor=textureCubeLodEXT(envMap, queryVec, float(maxMIPLevel));\n\t\t\t#else\n\t\t\t\tvec4 envMapColor=textureCube(envMap, queryVec, float(maxMIPLevel));\n\t\t\t#endif\n\t\t\tenvMapColor.rgb=envMapTexelToLinear(envMapColor).rgb;\n\t\t#elif defined(ENVMAP_TYPE_CUBE_UV)\n\t\t\tvec4 envMapColor=textureCubeUV(envMap, worldNormal, 1.0);\n\t\t#else\n\t\t\tvec4 envMapColor=vec4(0.0);\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel(const in float roughness, const in int maxMIPLevel){\n\t\tfloat maxMIPLevelScalar=float(maxMIPLevel);\n\t\tfloat sigma=PI * roughness * roughness /(1.0 + roughness);\n\t\tfloat desiredMIPLevel=maxMIPLevelScalar + log2(sigma);\n\t\treturn clamp(desiredMIPLevel, 0.0, maxMIPLevelScalar);\n\t}\n\tvec3 getLightProbeIndirectRadiance(const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel){\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec=reflect(-viewDir, normal);\n\t\t\treflectVec=normalize(mix(reflectVec, normal, roughness * roughness));\n\t\t#else\n\t\t\tvec3 reflectVec=refract(-viewDir, normal, refractionRatio);\n\t\t#endif\n\t\treflectVec=inverseTransformDirection(reflectVec, viewMatrix);\n\t\tfloat specularMIPLevel=getSpecularMIPLevel(roughness, maxMIPLevel);\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec=vec3(flipEnvMap * reflectVec.x, reflectVec.yz);\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor=textureCubeLodEXT(envMap, queryReflectVec, specularMIPLevel);\n\t\t\t#else\n\t\t\t\tvec4 envMapColor=textureCube(envMap, queryReflectVec, specularMIPLevel);\n\t\t\t#endif\n\t\t\tenvMapColor.rgb=envMapTexelToLinear(envMapColor).rgb;\n\t\t#elif defined(ENVMAP_TYPE_CUBE_UV)\n\t\t\tvec4 envMapColor=textureCubeUV(envMap, reflectVec, roughness);\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition=worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif(isOrthographic){\n\t\t\tcameraToVertex=normalize(vec3(- viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ]));\n\t\t}else{\n\t\t\tcameraToVertex=normalize(worldPosition.xyz - cameraPosition);\n\t\t}\n\t\tvec3 worldNormal=inverseTransformDirection(transformedNormal, viewMatrix);\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect=reflect(cameraToVertex, worldNormal);\n\t\t#else\n\t\t\tvReflect=refract(cameraToVertex, worldNormal, refractionRatio);\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth=- mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor=1.0 - exp(- fogDensity * fogDensity * fogDepth * fogDepth);\n\t#else\n\t\tfloat fogFactor=smoothstep(fogNear, fogFar, fogDepth);\n\t#endif\n\tgl_FragColor.rgb=mix(gl_FragColor.rgb, fogColor, fogFactor);\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance(vec3 normal, vec3 lightDirection){\n\tfloat dotNL=dot(normal, lightDirection);\n\tvec2 coord=vec2(dotNL * 0.5 + 0.5, 0.0);\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D(gradientMap, coord).rgb;\n\t#else\n\t\treturn(coord.x < 0.7) ? vec3(0.7):vec3(1.0);\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel=texture2D(lightMap, vUv2);\n\treflectedLight.indirectDiffuse +=PI * lightMapTexelToLinear(lightMapTexel).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse=vec3(1.0);\nGeometricContext geometry;\ngeometry.position=mvPosition.xyz;\ngeometry.normal=normalize(transformedNormal);\ngeometry.viewDir=(isOrthographic) ? vec3(0, 0, 1):normalize(-mvPosition.xyz);\nGeometricContext backGeometry;\nbackGeometry.position=geometry.position;\nbackGeometry.normal=-geometry.normal;\nbackGeometry.viewDir=geometry.viewDir;\nvLightFront=vec3(0.0);\nvIndirectFront=vec3(0.0);\n#ifdef DOUBLE_SIDED\n\tvLightBack=vec3(0.0);\n\tvIndirectBack=vec3(0.0);\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront +=getAmbientLightIrradiance(ambientLightColor);\nvIndirectFront +=getLightProbeIrradiance(lightProbe, geometry);\n#ifdef DOUBLE_SIDED\n\tvIndirectBack +=getAmbientLightIrradiance(ambientLightColor);\n\tvIndirectBack +=getLightProbeIrradiance(lightProbe, backGeometry);\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_POINT_LIGHTS; i ++){\n\t\tgetPointDirectLightIrradiance(pointLights[ i ], geometry, directLight);\n\t\tdotNL=dot(geometry.normal, directLight.direction);\n\t\tdirectLightColor_Diffuse=PI * directLight.color;\n\t\tvLightFront +=saturate(dotNL) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack +=saturate(-dotNL) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_SPOT_LIGHTS; i ++){\n\t\tgetSpotDirectLightIrradiance(spotLights[ i ], geometry, directLight);\n\t\tdotNL=dot(geometry.normal, directLight.direction);\n\t\tdirectLightColor_Diffuse=PI * directLight.color;\n\t\tvLightFront +=saturate(dotNL) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack +=saturate(-dotNL) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_DIR_LIGHTS; i ++){\n\t\tgetDirectionalDirectLightIrradiance(directionalLights[ i ], geometry, directLight);\n\t\tdotNL=dot(geometry.normal, directLight.direction);\n\t\tdirectLightColor_Diffuse=PI * directLight.color;\n\t\tvLightFront +=saturate(dotNL) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack +=saturate(-dotNL) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_HEMI_LIGHTS; i ++){\n\t\tvIndirectFront +=getHemisphereLightIrradiance(hemisphereLights[ i ], geometry);\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack +=getHemisphereLightIrradiance(hemisphereLights[ i ], backGeometry);\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt(in vec3 normal, in vec3 shCoefficients[ 9 ]){\n\tfloat x=normal.x, y=normal.y, z=normal.z;\n\tvec3 result=shCoefficients[ 0 ] * 0.886227;\n\tresult +=shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult +=shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult +=shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult +=shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult +=shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult +=shCoefficients[ 6 ] *(0.743125 * z * z - 0.247708);\n\tresult +=shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult +=shCoefficients[ 8 ] * 0.429043 *(x * x - y * y);\n\treturn result;\n}\nvec3 getLightProbeIrradiance(const in vec3 lightProbe[ 9 ], const in GeometricContext geometry){\n\tvec3 worldNormal=inverseTransformDirection(geometry.normal, viewMatrix);\n\tvec3 irradiance=shGetIrradianceAt(worldNormal, lightProbe);\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance(const in vec3 ambientLightColor){\n\tvec3 irradiance=ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *=PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance(const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight){\n\t\tdirectLight.color=directionalLight.color;\n\t\tdirectLight.direction=directionalLight.direction;\n\t\tdirectLight.visible=true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance(const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight){\n\t\tvec3 lVector=pointLight.position - geometry.position;\n\t\tdirectLight.direction=normalize(lVector);\n\t\tfloat lightDistance=length(lVector);\n\t\tdirectLight.color=pointLight.color;\n\t\tdirectLight.color *=punctualLightIntensityToIrradianceFactor(lightDistance, pointLight.distance, pointLight.decay);\n\t\tdirectLight.visible=(directLight.color!=vec3(0.0));\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance(const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight){\n\t\tvec3 lVector=spotLight.position - geometry.position;\n\t\tdirectLight.direction=normalize(lVector);\n\t\tfloat lightDistance=length(lVector);\n\t\tfloat angleCos=dot(directLight.direction, spotLight.direction);\n\t\tif(angleCos > spotLight.coneCos){\n\t\t\tfloat spotEffect=smoothstep(spotLight.coneCos, spotLight.penumbraCos, angleCos);\n\t\t\tdirectLight.color=spotLight.color;\n\t\t\tdirectLight.color *=spotEffect * punctualLightIntensityToIrradianceFactor(lightDistance, spotLight.distance, spotLight.decay);\n\t\t\tdirectLight.visible=true;\n\t\t}else{\n\t\t\tdirectLight.color=vec3(0.0);\n\t\t\tdirectLight.visible=false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance(const in HemisphereLight hemiLight, const in GeometricContext geometry){\n\t\tfloat dotNL=dot(geometry.normal, hemiLight.direction);\n\t\tfloat hemiDiffuseWeight=0.5 * dotNL + 0.5;\n\t\tvec3 irradiance=mix(hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight);\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *=PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor=diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon(const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight){\n\tvec3 irradiance=getGradientIrradiance(geometry.normal, directLight.direction) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *=PI;\n\t#endif\n\treflectedLight.directDiffuse +=irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n}\nvoid RE_IndirectDiffuse_Toon(const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight){\n\treflectedLight.indirectDiffuse +=irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD(material)\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor=diffuseColor.rgb;\nmaterial.specularColor=specular;\nmaterial.specularShininess=shininess;\nmaterial.specularStrength=specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong(const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight){\n\tfloat dotNL=saturate(dot(geometry.normal, directLight.direction));\n\tvec3 irradiance=dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *=PI;\n\t#endif\n\treflectedLight.directDiffuse +=irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n\treflectedLight.directSpecular +=irradiance * BRDF_Specular_BlinnPhong(directLight, geometry, material.specularColor, material.specularShininess) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong(const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight){\n\treflectedLight.indirectDiffuse +=irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD(material)\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor=diffuseColor.rgb *(1.0 - metalnessFactor);\nvec3 dxy=max(abs(dFdx(geometryNormal)), abs(dFdy(geometryNormal)));\nfloat geometryRoughness=max(max(dxy.x, dxy.y), dxy.z);\nmaterial.specularRoughness=max(roughnessFactor, 0.0525);material.specularRoughness +=geometryRoughness;\nmaterial.specularRoughness=min(material.specularRoughness, 1.0);\n#ifdef REFLECTIVITY\n\tmaterial.specularColor=mix(vec3(MAXIMUM_SPECULAR_COEFFICIENT * pow2(reflectivity)), diffuseColor.rgb, metalnessFactor);\n#else\n\tmaterial.specularColor=mix(vec3(DEFAULT_SPECULAR_COEFFICIENT), diffuseColor.rgb, metalnessFactor);\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat=clearcoat;\n\tmaterial.clearcoatRoughness=clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *=texture2D(clearcoatMap, vUv).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *=texture2D(clearcoatRoughnessMap, vUv).y;\n\t#endif\n\tmaterial.clearcoat=saturate(material.clearcoat);\tmaterial.clearcoatRoughness=max(material.clearcoatRoughness, 0.0525);\n\tmaterial.clearcoatRoughness +=geometryRoughness;\n\tmaterial.clearcoatRoughness=min(material.clearcoatRoughness, 1.0);\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor=sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox(const in float roughness, const in float dotNL){\n\treturn DEFAULT_SPECULAR_COEFFICIENT +(1.0 - DEFAULT_SPECULAR_COEFFICIENT) *(pow(1.0 - dotNL, 5.0) * pow(1.0 - roughness, 2.0));\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical(const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight){\n\t\tvec3 normal=geometry.normal;\n\t\tvec3 viewDir=geometry.viewDir;\n\t\tvec3 position=geometry.position;\n\t\tvec3 lightPos=rectAreaLight.position;\n\t\tvec3 halfWidth=rectAreaLight.halfWidth;\n\t\tvec3 halfHeight=rectAreaLight.halfHeight;\n\t\tvec3 lightColor=rectAreaLight.color;\n\t\tfloat roughness=material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ]=lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ]=lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ]=lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ]=lightPos + halfWidth + halfHeight;\n\t\tvec2 uv=LTC_Uv(normal, viewDir, roughness);\n\t\tvec4 t1=texture2D(ltc_1, uv);\n\t\tvec4 t2=texture2D(ltc_2, uv);\n\t\tmat3 mInv=mat3(\n\t\t\tvec3(t1.x, 0, t1.y),\n\t\t\tvec3(\t\t0, 1,\t\t0),\n\t\t\tvec3(t1.z, 0, t1.w)\n\t\t);\n\t\tvec3 fresnel=(material.specularColor * t2.x +(vec3(1.0) - material.specularColor) * t2.y);\n\t\treflectedLight.directSpecular +=lightColor * fresnel * LTC_Evaluate(normal, viewDir, position, mInv, rectCoords);\n\t\treflectedLight.directDiffuse +=lightColor * material.diffuseColor * LTC_Evaluate(normal, viewDir, position, mat3(1.0), rectCoords);\n\t}\n#endif\nvoid RE_Direct_Physical(const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight){\n\tfloat dotNL=saturate(dot(geometry.normal, directLight.direction));\n\tvec3 irradiance=dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *=PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL=saturate(dot(geometry.clearcoatNormal, directLight.direction));\n\t\tvec3 ccIrradiance=ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *=PI;\n\t\t#endif\n\t\tfloat clearcoatDHR=material.clearcoat * clearcoatDHRApprox(material.clearcoatRoughness, ccDotNL);\n\t\treflectedLight.directSpecular +=ccIrradiance * material.clearcoat * BRDF_Specular_GGX(directLight, geometry.viewDir, geometry.clearcoatNormal, vec3(DEFAULT_SPECULAR_COEFFICIENT), material.clearcoatRoughness);\n\t#else\n\t\tfloat clearcoatDHR=0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular +=(1.0 - clearcoatDHR) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular +=(1.0 - clearcoatDHR) * irradiance * BRDF_Specular_GGX(directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse +=(1.0 - clearcoatDHR) * irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n}\nvoid RE_IndirectDiffuse_Physical(const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight){\n\treflectedLight.indirectDiffuse +=irradiance * BRDF_Diffuse_Lambert(material.diffuseColor);\n}\nvoid RE_IndirectSpecular_Physical(const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight){\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV=saturate(dot(geometry.clearcoatNormal, geometry.viewDir));\n\t\treflectedLight.indirectSpecular +=clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment(geometry.viewDir, geometry.clearcoatNormal, vec3(DEFAULT_SPECULAR_COEFFICIENT), material.clearcoatRoughness);\n\t\tfloat ccDotNL=ccDotNV;\n\t\tfloat clearcoatDHR=material.clearcoat * clearcoatDHRApprox(material.clearcoatRoughness, ccDotNL);\n\t#else\n\t\tfloat clearcoatDHR=0.0;\n\t#endif\n\tfloat clearcoatInv=1.0 - clearcoatDHR;\n\tvec3 singleScattering=vec3(0.0);\n\tvec3 multiScattering=vec3(0.0);\n\tvec3 cosineWeightedIrradiance=irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment(geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering);\n\tvec3 diffuse=material.diffuseColor *(1.0 -(singleScattering + multiScattering));\n\treflectedLight.indirectSpecular +=clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular +=multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse +=diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion(const in float dotNV, const in float ambientOcclusion, const in float roughness){\n\treturn saturate(pow(dotNV + ambientOcclusion, exp2(- 16.0 * roughness - 1.0)) - 1.0 + ambientOcclusion);\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position=- vViewPosition;\ngeometry.normal=normal;\ngeometry.viewDir=(isOrthographic) ? vec3(0, 0, 1):normalize(vViewPosition);\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal=clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if(NUM_POINT_LIGHTS > 0)&&defined(RE_Direct)\n\tPointLight pointLight;\n\t#if defined(USE_SHADOWMAP)&&NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_POINT_LIGHTS; i ++){\n\t\tpointLight=pointLights[ i ];\n\t\tgetPointDirectLightIrradiance(pointLight, geometry, directLight);\n\t\t#if defined(USE_SHADOWMAP)&&(UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS)\n\t\tpointLightShadow=pointLightShadows[ i ];\n\t\tdirectLight.color *=all(bvec2(directLight.visible, receiveShadow)) ? getPointShadow(pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar):1.0;\n\t\t#endif\n\t\tRE_Direct(directLight, geometry, material, reflectedLight);\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if(NUM_SPOT_LIGHTS > 0)&&defined(RE_Direct)\n\tSpotLight spotLight;\n\t#if defined(USE_SHADOWMAP)&&NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_SPOT_LIGHTS; i ++){\n\t\tspotLight=spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance(spotLight, geometry, directLight);\n\t\t#if defined(USE_SHADOWMAP)&&(UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS)\n\t\tspotLightShadow=spotLightShadows[ i ];\n\t\tdirectLight.color *=all(bvec2(directLight.visible, receiveShadow)) ? getShadow(spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ]):1.0;\n\t\t#endif\n\t\tRE_Direct(directLight, geometry, material, reflectedLight);\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if(NUM_DIR_LIGHTS > 0)&&defined(RE_Direct)\n\tDirectionalLight directionalLight;\n\t#if defined(USE_SHADOWMAP)&&NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_DIR_LIGHTS; i ++){\n\t\tdirectionalLight=directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance(directionalLight, geometry, directLight);\n\t\t#if defined(USE_SHADOWMAP)&&(UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS)\n\t\tdirectionalLightShadow=directionalLightShadows[ i ];\n\t\tdirectLight.color *=all(bvec2(directLight.visible, receiveShadow)) ? getShadow(directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ]):1.0;\n\t\t#endif\n\t\tRE_Direct(directLight, geometry, material, reflectedLight);\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if(NUM_RECT_AREA_LIGHTS > 0)&&defined(RE_Direct_RectArea)\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_RECT_AREA_LIGHTS; i ++){\n\t\trectAreaLight=rectAreaLights[ i ];\n\t\tRE_Direct_RectArea(rectAreaLight, geometry, material, reflectedLight);\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined(RE_IndirectDiffuse)\n\tvec3 iblIrradiance=vec3(0.0);\n\tvec3 irradiance=getAmbientLightIrradiance(ambientLightColor);\n\tirradiance +=getLightProbeIrradiance(lightProbe, geometry);\n\t#if(NUM_HEMI_LIGHTS > 0)\n\t\t#pragma unroll_loop_start\n\t\tfor(int i=0; i < NUM_HEMI_LIGHTS; i ++){\n\t\t\tirradiance +=getHemisphereLightIrradiance(hemisphereLights[ i ], geometry);\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined(RE_IndirectSpecular)\n\tvec3 radiance=vec3(0.0);\n\tvec3 clearcoatRadiance=vec3(0.0);\n#endif",lights_fragment_maps:"#if defined(RE_IndirectDiffuse)\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel=texture2D(lightMap, vUv2);\n\t\tvec3 lightMapIrradiance=lightMapTexelToLinear(lightMapTexel).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *=PI;\n\t\t#endif\n\t\tirradiance +=lightMapIrradiance;\n\t#endif\n\t#if defined(USE_ENVMAP)&&defined(STANDARD)&&defined(ENVMAP_TYPE_CUBE_UV)\n\t\tiblIrradiance +=getLightProbeIndirectIrradiance(geometry, maxMipLevel);\n\t#endif\n#endif\n#if defined(USE_ENVMAP)&&defined(RE_IndirectSpecular)\n\tradiance +=getLightProbeIndirectRadiance(geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel);\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance +=getLightProbeIndirectRadiance(geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel);\n\t#endif\n#endif",lights_fragment_end:"#if defined(RE_IndirectDiffuse)\n\tRE_IndirectDiffuse(irradiance, geometry, material, reflectedLight);\n#endif\n#if defined(RE_IndirectSpecular)\n\tRE_IndirectSpecular(radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight);\n#endif",logdepthbuf_fragment:"#if defined(USE_LOGDEPTHBUF)&&defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT=vIsPerspective==0.0 ? gl_FragCoord.z:log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined(USE_LOGDEPTHBUF)&&defined(USE_LOGDEPTHBUF_EXT)\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth=1.0 + gl_Position.w;\n\t\tvIsPerspective=float(isPerspectiveMatrix(projectionMatrix));\n\t#else\n\t\tif(isPerspectiveMatrix(projectionMatrix)){\n\t\t\tgl_Position.z=log2(max(EPSILON, gl_Position.w + 1.0)) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *=gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor=texture2D(map, vUv);\n\ttexelColor=mapTexelToLinear(texelColor);\n\tdiffuseColor *=texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined(USE_MAP)||defined(USE_ALPHAMAP)\n\tvec2 uv=(uvTransform * vec3(gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1)).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel=texture2D(map, uv);\n\tdiffuseColor *=mapTexelToLinear(mapTexel);\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *=texture2D(alphaMap, uv).g;\n#endif",map_particle_pars_fragment:"#if defined(USE_MAP)||defined(USE_ALPHAMAP)\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor=metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness=texture2D(metalnessMap, vUv);\n\tmetalnessFactor *=texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *=morphTargetBaseInfluence;\n\tobjectNormal +=morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal +=morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal +=morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal +=morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *=morphTargetBaseInfluence;\n\ttransformed +=morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed +=morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed +=morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed +=morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed +=morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed +=morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed +=morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed +=morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection=gl_FrontFacing ? 1.0:- 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx=vec3(dFdx(vViewPosition.x), dFdx(vViewPosition.y), dFdx(vViewPosition.z));\n\tvec3 fdy=vec3(dFdy(vViewPosition.x), dFdy(vViewPosition.y), dFdy(vViewPosition.z));\n\tvec3 normal=normalize(cross(fdx, fdy));\n#else\n\tvec3 normal=normalize(vNormal);\n\t#ifdef DOUBLE_SIDED\n\t\tnormal=normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent=normalize(vTangent);\n\t\tvec3 bitangent=normalize(vBitangent);\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent=tangent * faceDirection;\n\t\t\tbitangent=bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined(TANGENTSPACE_NORMALMAP)||defined(USE_CLEARCOAT_NORMALMAP)\n\t\t\tmat3 vTBN=mat3(tangent, bitangent, normal);\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal=normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal=texture2D(normalMap, vUv).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal=- normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal=normal * faceDirection;\n\t#endif\n\tnormal=normalize(normalMatrix * normal);\n#elif defined(TANGENTSPACE_NORMALMAP)\n\tvec3 mapN=texture2D(normalMap, vUv).xyz * 2.0 - 1.0;\n\tmapN.xy *=normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal=normalize(vTBN * mapN);\n\t#else\n\t\tnormal=perturbNormal2Arb(-vViewPosition, normal, mapN, faceDirection);\n\t#endif\n#elif defined(USE_BUMPMAP)\n\tnormal=perturbNormalArb(-vViewPosition, normal, dHdxy_fwd(), faceDirection);\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined(USE_TANGENT)&&(defined(TANGENTSPACE_NORMALMAP)||defined(USE_CLEARCOAT_NORMALMAP))\n\tvec3 perturbNormal2Arb(vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection){\n\t\tvec3 q0=vec3(dFdx(eye_pos.x), dFdx(eye_pos.y), dFdx(eye_pos.z));\n\t\tvec3 q1=vec3(dFdy(eye_pos.x), dFdy(eye_pos.y), dFdy(eye_pos.z));\n\t\tvec2 st0=dFdx(vUv.st);\n\t\tvec2 st1=dFdy(vUv.st);\n\t\tvec3 N=surf_norm;\n\t\tvec3 q1perp=cross(q1, N);\n\t\tvec3 q0perp=cross(N, q0);\n\t\tvec3 T=q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B=q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det=max(dot(T, T), dot(B, B));\n\t\tfloat scale=(det==0.0) ? 0.0:faceDirection * inversesqrt(det);\n\t\treturn normalize(T *(mapN.x * scale) + B *(mapN.y * scale) + N * mapN.z);\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal=geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN=texture2D(clearcoatNormalMap, vUv).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *=clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal=normalize(vTBN * clearcoatMapN);\n\t#else\n\t\tclearcoatNormal=perturbNormal2Arb(- vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection);\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB(const in vec3 normal){\n\treturn normalize(normal) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal(const in vec3 rgb){\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale=256. / 255.;const float UnpackDownscale=255. / 256.;\nconst vec3 PackFactors=vec3(256. * 256. * 256., 256. * 256., 256.);\nconst vec4 UnpackFactors=UnpackDownscale / vec4(PackFactors, 1.);\nconst float ShiftRight8=1. / 256.;\nvec4 packDepthToRGBA(const in float v){\n\tvec4 r=vec4(fract(v * PackFactors), v);\n\tr.yzw -=r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth(const in vec4 v){\n\treturn dot(v, UnpackFactors);\n}\nvec4 pack2HalfToRGBA(vec2 v){\n\tvec4 r=vec4(v.x, fract(v.x * 255.0), v.y, fract(v.y * 255.0));\n\treturn vec4(r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half(vec4 v){\n\treturn vec2(v.x +(v.y / 255.0), v.z +(v.w / 255.0));\n}\nfloat viewZToOrthographicDepth(const in float viewZ, const in float near, const in float far){\n\treturn(viewZ + near) /(near - far);\n}\nfloat orthographicDepthToViewZ(const in float linearClipZ, const in float near, const in float far){\n\treturn linearClipZ *(near - far) - near;\n}\nfloat viewZToPerspectiveDepth(const in float viewZ, const in float near, const in float far){\n\treturn ((near + viewZ) * far) / ((far - near) * viewZ);\n}\nfloat perspectiveDepthToViewZ(const in float invClipZ, const in float near, const in float far){\n\treturn(near * far) /(( far - near) * invClipZ - far);\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *=gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition=vec4(transformed, 1.0);\n#ifdef USE_INSTANCING\n\tmvPosition=instanceMatrix * mvPosition;\n#endif\nmvPosition=modelViewMatrix * mvPosition;\ngl_Position=projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb=dithering(gl_FragColor.rgb);\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering(vec3 color){\n\t\tfloat grid_position=rand (gl_FragCoord.xy);\n\t\tvec3 dither_shift_RGB=vec3(0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0);\n\t\tdither_shift_RGB=mix(2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position);\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor=roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness=texture2D(roughnessMap, vUv);\n\troughnessFactor *=texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare(sampler2D depths, vec2 uv, float compare){\n\t\treturn step(compare, unpackRGBAToDepth(texture2D(depths, uv)));\n\t}\n\tvec2 texture2DDistribution(sampler2D shadow, vec2 uv){\n\t\treturn unpackRGBATo2Half(texture2D(shadow, uv));\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare){\n\t\tfloat occlusion=1.0;\n\t\tvec2 distribution=texture2DDistribution(shadow, uv);\n\t\tfloat hard_shadow=step(compare , distribution.x);\n\t\tif(hard_shadow!=1.0){\n\t\t\tfloat distance=compare - distribution.x ;\n\t\t\tfloat variance=max(0.00000, distribution.y * distribution.y);\n\t\t\tfloat softness_probability=variance / (variance + distance * distance);\t\t\tsoftness_probability=clamp(( softness_probability - 0.3) /(0.95 - 0.3), 0.0, 1.0);\t\t\tocclusion=clamp(max(hard_shadow, softness_probability), 0.0, 1.0);\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow(sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord){\n\t\tfloat shadow=1.0;\n\t\tshadowCoord.xyz /=shadowCoord.w;\n\t\tshadowCoord.z +=shadowBias;\n\t\tbvec4 inFrustumVec=bvec4(shadowCoord.x >=0.0, shadowCoord.x <=1.0, shadowCoord.y >=0.0, shadowCoord.y <=1.0);\n\t\tbool inFrustum=all(inFrustumVec);\n\t\tbvec2 frustumTestVec=bvec2(inFrustum, shadowCoord.z <=1.0);\n\t\tbool frustumTest=all(frustumTestVec);\n\t\tif(frustumTest){\n\t\t#if defined(SHADOWMAP_TYPE_PCF)\n\t\t\tvec2 texelSize=vec2(1.0) / shadowMapSize;\n\t\t\tfloat dx0=- texelSize.x * shadowRadius;\n\t\t\tfloat dy0=- texelSize.y * shadowRadius;\n\t\t\tfloat dx1=+ texelSize.x * shadowRadius;\n\t\t\tfloat dy1=+ texelSize.y * shadowRadius;\n\t\t\tfloat dx2=dx0 / 2.0;\n\t\t\tfloat dy2=dy0 / 2.0;\n\t\t\tfloat dx3=dx1 / 2.0;\n\t\t\tfloat dy3=dy1 / 2.0;\n\t\t\tshadow=(\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx0, dy0), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(0.0, dy0), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx1, dy0), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx2, dy2), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(0.0, dy2), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx3, dy2), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx0, 0.0), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx2, 0.0), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy, shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx3, 0.0), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx1, 0.0), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx2, dy3), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(0.0, dy3), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx3, dy3), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx0, dy1), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(0.0, dy1), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, shadowCoord.xy + vec2(dx1, dy1), shadowCoord.z)\n\t\t\t) *(1.0 / 17.0);\n\t\t#elif defined(SHADOWMAP_TYPE_PCF_SOFT)\n\t\t\tvec2 texelSize=vec2(1.0) / shadowMapSize;\n\t\t\tfloat dx=texelSize.x;\n\t\t\tfloat dy=texelSize.y;\n\t\t\tvec2 uv=shadowCoord.xy;\n\t\t\tvec2 f=fract(uv * shadowMapSize + 0.5);\n\t\t\tuv -=f * texelSize;\n\t\t\tshadow=(\n\t\t\t\ttexture2DCompare(shadowMap, uv, shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, uv + vec2(dx, 0.0), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, uv + vec2(0.0, dy), shadowCoord.z) +\n\t\t\t\ttexture2DCompare(shadowMap, uv + texelSize, shadowCoord.z) +\n\t\t\t\tmix(texture2DCompare(shadowMap, uv + vec2(-dx, 0.0), shadowCoord.z), \n\t\t\t\t\t texture2DCompare(shadowMap, uv + vec2(2.0 * dx, 0.0), shadowCoord.z),\n\t\t\t\t\t f.x) +\n\t\t\t\tmix(texture2DCompare(shadowMap, uv + vec2(-dx, dy), shadowCoord.z), \n\t\t\t\t\t texture2DCompare(shadowMap, uv + vec2(2.0 * dx, dy), shadowCoord.z),\n\t\t\t\t\t f.x) +\n\t\t\t\tmix(texture2DCompare(shadowMap, uv + vec2(0.0, -dy), shadowCoord.z), \n\t\t\t\t\t texture2DCompare(shadowMap, uv + vec2(0.0, 2.0 * dy), shadowCoord.z),\n\t\t\t\t\t f.y) +\n\t\t\t\tmix(texture2DCompare(shadowMap, uv + vec2(dx, -dy), shadowCoord.z), \n\t\t\t\t\t texture2DCompare(shadowMap, uv + vec2(dx, 2.0 * dy), shadowCoord.z),\n\t\t\t\t\t f.y) +\n\t\t\t\tmix(mix(texture2DCompare(shadowMap, uv + vec2(-dx, -dy), shadowCoord.z), \n\t\t\t\t\t\t\ttexture2DCompare(shadowMap, uv + vec2(2.0 * dx, -dy), shadowCoord.z),\n\t\t\t\t\t\t\tf.x),\n\t\t\t\t\t mix(texture2DCompare(shadowMap, uv + vec2(-dx, 2.0 * dy), shadowCoord.z), \n\t\t\t\t\t\t\ttexture2DCompare(shadowMap, uv + vec2(2.0 * dx, 2.0 * dy), shadowCoord.z),\n\t\t\t\t\t\t\tf.x),\n\t\t\t\t\t f.y)\n\t\t\t) *(1.0 / 9.0);\n\t\t#elif defined(SHADOWMAP_TYPE_VSM)\n\t\t\tshadow=VSMShadow(shadowMap, shadowCoord.xy, shadowCoord.z);\n\t\t#else\n\t\t\tshadow=texture2DCompare(shadowMap, shadowCoord.xy, shadowCoord.z);\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV(vec3 v, float texelSizeY){\n\t\tvec3 absV=abs(v);\n\t\tfloat scaleToCube=1.0 / max(absV.x, max(absV.y, absV.z));\n\t\tabsV *=scaleToCube;\n\t\tv *=scaleToCube *(1.0 - 2.0 * texelSizeY);\n\t\tvec2 planar=v.xy;\n\t\tfloat almostATexel=1.5 * texelSizeY;\n\t\tfloat almostOne=1.0 - almostATexel;\n\t\tif(absV.z >=almostOne){\n\t\t\tif(v.z > 0.0)\n\t\t\t\tplanar.x=4.0 - v.x;\n\t\t}else if(absV.x >=almostOne){\n\t\t\tfloat signX=sign(v.x);\n\t\t\tplanar.x=v.z * signX + 2.0 * signX;\n\t\t}else if(absV.y >=almostOne){\n\t\t\tfloat signY=sign(v.y);\n\t\t\tplanar.x=v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y=v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2(0.125, 0.25) * planar + vec2(0.375, 0.75);\n\t}\n\tfloat getPointShadow(sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar){\n\t\tvec2 texelSize=vec2(1.0) /(shadowMapSize * vec2(4.0, 2.0));\n\t\tvec3 lightToPosition=shadowCoord.xyz;\n\t\tfloat dp=(length(lightToPosition) - shadowCameraNear) /(shadowCameraFar - shadowCameraNear);\t\tdp +=shadowBias;\n\t\tvec3 bd3D=normalize(lightToPosition);\n\t\t#if defined(SHADOWMAP_TYPE_PCF)||defined(SHADOWMAP_TYPE_PCF_SOFT)||defined(SHADOWMAP_TYPE_VSM)\n\t\t\tvec2 offset=vec2(- 1, 1) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare(shadowMap, cubeToUV(bd3D + offset.xyy, texelSize.y), dp) +\n\t\t\t\ttexture2DCompare(shadowMap, cubeToUV(bd3D + offset.yyy, texelSize.y), dp) +\n\t\t\t\ttexture2DCompare(shadowMap, cubeToUV(bd3D + offset.xyx, texelSize.y), dp) +\n\t\t\t\ttexture2DCompare(shadowMap, cubeToUV(bd3D + offset.yyx, texelSize.y), dp) +\n\t\t\t\ttexture2DCompare(shadowMap, cubeToUV(bd3D, texelSize.y), dp) +\n\t\t\t\ttexture2DCompare(shadowMap, cubeToUV(bd3D + offset.xxy, texelSize.y), dp) +\n\t\t\t\ttexture2DCompare(shadowMap, cubeToUV(bd3D + offset.yxy, texelSize.y), dp) +\n\t\t\t\ttexture2DCompare(shadowMap, cubeToUV(bd3D + offset.xxx, texelSize.y), dp) +\n\t\t\t\ttexture2DCompare(shadowMap, cubeToUV(bd3D + offset.yxx, texelSize.y), dp)\n\t\t\t) *(1.0 / 9.0);\n\t\t#else\n\t\t\treturn texture2DCompare(shadowMap, cubeToUV(bd3D, texelSize.y), dp);\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0||NUM_SPOT_LIGHT_SHADOWS > 0||NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal=inverseTransformDirection(transformedNormal, viewMatrix);\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_DIR_LIGHT_SHADOWS; i ++){\n\t\tshadowWorldPosition=worldPosition + vec4(shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0);\n\t\tvDirectionalShadowCoord[ i ]=directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_SPOT_LIGHT_SHADOWS; i ++){\n\t\tshadowWorldPosition=worldPosition + vec4(shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0);\n\t\tvSpotShadowCoord[ i ]=spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_POINT_LIGHT_SHADOWS; i ++){\n\t\tshadowWorldPosition=worldPosition + vec4(shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0);\n\t\tvPointShadowCoord[ i ]=pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask(){\n\tfloat shadow=1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_DIR_LIGHT_SHADOWS; i ++){\n\t\tdirectionalLight=directionalLightShadows[ i ];\n\t\tshadow *=receiveShadow ? getShadow(directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ]):1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_SPOT_LIGHT_SHADOWS; i ++){\n\t\tspotLight=spotLightShadows[ i ];\n\t\tshadow *=receiveShadow ? getShadow(spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ]):1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor(int i=0; i < NUM_POINT_LIGHT_SHADOWS; i ++){\n\t\tpointLight=pointLightShadows[ i ];\n\t\tshadow *=receiveShadow ? getPointShadow(pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar):1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX=getBoneMatrix(skinIndex.x);\n\tmat4 boneMatY=getBoneMatrix(skinIndex.y);\n\tmat4 boneMatZ=getBoneMatrix(skinIndex.z);\n\tmat4 boneMatW=getBoneMatrix(skinIndex.w);\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix(const in float i){\n\t\t\tfloat j=i * 4.0;\n\t\t\tfloat x=mod(j, float(boneTextureSize));\n\t\t\tfloat y=floor(j / float(boneTextureSize));\n\t\t\tfloat dx=1.0 / float(boneTextureSize);\n\t\t\tfloat dy=1.0 / float(boneTextureSize);\n\t\t\ty=dy *(y + 0.5);\n\t\t\tvec4 v1=texture2D(boneTexture, vec2(dx *(x + 0.5), y));\n\t\t\tvec4 v2=texture2D(boneTexture, vec2(dx *(x + 1.5), y));\n\t\t\tvec4 v3=texture2D(boneTexture, vec2(dx *(x + 2.5), y));\n\t\t\tvec4 v4=texture2D(boneTexture, vec2(dx *(x + 3.5), y));\n\t\t\tmat4 bone=mat4(v1, v2, v3, v4);\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix(const in float i){\n\t\t\tmat4 bone=boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex=bindMatrix * vec4(transformed, 1.0);\n\tvec4 skinned=vec4(0.0);\n\tskinned +=boneMatX * skinVertex * skinWeight.x;\n\tskinned +=boneMatY * skinVertex * skinWeight.y;\n\tskinned +=boneMatZ * skinVertex * skinWeight.z;\n\tskinned +=boneMatW * skinVertex * skinWeight.w;\n\ttransformed=(bindMatrixInverse * skinned).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix=mat4(0.0);\n\tskinMatrix +=skinWeight.x * boneMatX;\n\tskinMatrix +=skinWeight.y * boneMatY;\n\tskinMatrix +=skinWeight.z * boneMatZ;\n\tskinMatrix +=skinWeight.w * boneMatW;\n\tskinMatrix=bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal=vec4(skinMatrix * vec4(objectNormal, 0.0)).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent=vec4(skinMatrix * vec4(objectTangent, 0.0)).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular=texture2D(specularMap, vUv);\n\tspecularStrength=texelSpecular.r;\n#else\n\tspecularStrength=1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined(TONE_MAPPING)\n\tgl_FragColor.rgb=toneMapping(gl_FragColor.rgb);\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp(a, 0.0, 1.0)\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping(vec3 color){\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping(vec3 color){\n\tcolor *=toneMappingExposure;\n\treturn saturate(color /(vec3(1.0) + color));\n}\nvec3 OptimizedCineonToneMapping(vec3 color){\n\tcolor *=toneMappingExposure;\n\tcolor=max(vec3(0.0), color - 0.004);\n\treturn pow(( color *(6.2 * color + 0.5)) /(color *(6.2 * color + 1.7) + 0.06), vec3(2.2));\n}\nvec3 RRTAndODTFit(vec3 v){\n\tvec3 a=v *(v + 0.0245786) - 0.000090537;\n\tvec3 b=v *(0.983729 * v + 0.4329510) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping(vec3 color){\n\tconst mat3 ACESInputMat=mat3(\n\t\tvec3(0.59719, 0.07600, 0.02840),\t\tvec3(0.35458, 0.90834, 0.13383),\n\t\tvec3(0.04823, 0.01566, 0.83777)\n\t);\n\tconst mat3 ACESOutputMat=mat3(\n\t\tvec3(\t1.60475, -0.10208, -0.00327),\t\tvec3(-0.53108,\t1.10813, -0.07276),\n\t\tvec3(-0.07367, -0.00605,\t1.07602)\n\t);\n\tcolor *=toneMappingExposure / 0.6;\n\tcolor=ACESInputMat * color;\n\tcolor=RRTAndODTFit(color);\n\tcolor=ACESOutputMat * color;\n\treturn saturate(color);\n}\nvec3 CustomToneMapping(vec3 color){ return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *=texture2D(transmissionMap, vUv).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if(defined(USE_UV)&&! defined(UVS_VERTEX_ONLY))\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv=(uvTransform * vec3(uv, 1)).xy;\n#endif",uv2_pars_fragment:"#if defined(USE_LIGHTMAP)||defined(USE_AOMAP)\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined(USE_LIGHTMAP)||defined(USE_AOMAP)\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined(USE_LIGHTMAP)||defined(USE_AOMAP)\n\tvUv2=(uv2Transform * vec3(uv2, 1)).xy;\n#endif",worldpos_vertex:"#if defined(USE_ENVMAP)||defined(DISTANCE)||defined(USE_SHADOWMAP)\n\tvec4 worldPosition=vec4(transformed, 1.0);\n\t#ifdef USE_INSTANCING\n\t\tworldPosition=instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition=modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main(){\n\tvec4 texColor=texture2D(t2D, vUv);\n\tgl_FragColor=mapTexelToLinear(texColor);\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main(){\n\tvUv=(uvTransform * vec3(uv, 1)).xy;\n\tgl_Position=vec4(position.xy, 1.0, 1.0);\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main(){\n\tvec3 vReflect=vWorldDirection;\n\t#include \n\tgl_FragColor=envColor;\n\tgl_FragColor.a *=opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main(){\n\tvWorldDirection=transformDirection(position, modelMatrix);\n\t#include \n\t#include \n\tgl_Position.z=gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING==3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main(){\n\t#include \n\tvec4 diffuseColor=vec4(1.0);\n\t#if DEPTH_PACKING==3200\n\t\tdiffuseColor.a=opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ=0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING==3200\n\t\tgl_FragColor=vec4(vec3(1.0 - fragCoordZ), opacity);\n\t#elif DEPTH_PACKING==3201\n\t\tgl_FragColor=packDepthToRGBA(fragCoordZ);\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main(){\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW=gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main (){\n\t#include \n\tvec4 diffuseColor=vec4(1.0);\n\t#include \n\t#include \n\t#include \n\tfloat dist=length(vWorldPosition - referencePosition);\n\tdist=(dist - nearDistance) /(farDistance - nearDistance);\n\tdist=saturate(dist);\n\tgl_FragColor=packDepthToRGBA(dist);\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition=worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main(){\n\tvec3 direction=normalize(vWorldDirection);\n\tvec2 sampleUV=equirectUv(direction);\n\tvec4 texColor=texture2D(tEquirect, sampleUV);\n\tgl_FragColor=mapTexelToLinear(texColor);\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main(){\n\tvWorldDirection=transformDirection(position, modelMatrix);\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\tif(mod(vLineDistance, totalSize) > dashSize){\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight=vec3(0.0);\n\tvec4 diffuseColor=vec4(diffuse, opacity);\n\t#include \n\t#include \n\toutgoingLight=diffuseColor.rgb;\n\tgl_FragColor=vec4(outgoingLight, diffuseColor.a);\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\tvLineDistance=scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\tvec4 diffuseColor=vec4(diffuse, opacity);\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight=ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel=texture2D(lightMap, vUv2);\n\t\treflectedLight.indirectDiffuse +=lightMapTexelToLinear(lightMapTexel).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse +=vec3(1.0);\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *=diffuseColor.rgb;\n\tvec3 outgoingLight=reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor=vec4(outgoingLight, diffuseColor.a);\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\tvec4 diffuseColor=vec4(diffuse, opacity);\n\tReflectedLight reflectedLight=ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n\tvec3 totalEmissiveRadiance=emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse +=(gl_FrontFacing) ? vIndirectFront:vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse +=vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *=BRDF_Diffuse_Lambert(diffuseColor.rgb);\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse=(gl_FrontFacing) ? vLightFront:vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse=vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *=BRDF_Diffuse_Lambert(diffuseColor.rgb) * getShadowMask();\n\t#include \n\tvec3 outgoingLight=reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor=vec4(outgoingLight, diffuseColor.a);\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\tvec4 diffuseColor=vec4(diffuse, opacity);\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir=normalize(vViewPosition);\n\tvec3 x=normalize(vec3(viewDir.z, 0.0, - viewDir.x));\n\tvec3 y=cross(viewDir, x);\n\tvec2 uv=vec2(dot(x, normal), dot(y, normal)) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor=texture2D(matcap, uv);\n\t\tmatcapColor=matcapTexelToLinear(matcapColor);\n\t#else\n\t\tvec4 matcapColor=vec4(1.0);\n\t#endif\n\tvec3 outgoingLight=diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor=vec4(outgoingLight, diffuseColor.a);\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal=normalize(transformedNormal);\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition=- mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\tvec4 diffuseColor=vec4(diffuse, opacity);\n\tReflectedLight reflectedLight=ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n\tvec3 totalEmissiveRadiance=emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight=reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor=vec4(outgoingLight, diffuseColor.a);\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal=normalize(transformedNormal);\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition=- mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\tvec4 diffuseColor=vec4(diffuse, opacity);\n\tReflectedLight reflectedLight=ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n\tvec3 totalEmissiveRadiance=emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight=reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor=vec4(outgoingLight, diffuseColor.a);\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal=normalize(transformedNormal);\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition=- mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\tvec4 diffuseColor=vec4(diffuse, opacity);\n\tReflectedLight reflectedLight=ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n\tvec3 totalEmissiveRadiance=emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission=transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight=reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *=mix(saturate(1. - totalTransmission + linearToRelativeLuminance(reflectedLight.directSpecular + reflectedLight.indirectSpecular)), 1.0, metalness);\n\t#endif\n\tgl_FragColor=vec4(outgoingLight, diffuseColor.a);\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal=normalize(transformedNormal);\n\t#ifdef USE_TANGENT\n\t\tvTangent=normalize(transformedTangent);\n\t\tvBitangent=normalize(cross(vNormal, vTangent) * tangent.w);\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition=- mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined(FLAT_SHADED)||defined(USE_BUMPMAP)||defined(TANGENTSPACE_NORMALMAP)\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor=vec4(packNormalToRGB(normal), opacity);\n}",normal_vert:"#define NORMAL\n#if defined(FLAT_SHADED)||defined(USE_BUMPMAP)||defined(TANGENTSPACE_NORMALMAP)\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal=normalize(transformedNormal);\n\t#ifdef USE_TANGENT\n\t\tvTangent=normalize(transformedTangent);\n\t\tvBitangent=normalize(cross(vNormal, vTangent) * tangent.w);\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined(FLAT_SHADED)||defined(USE_BUMPMAP)||defined(TANGENTSPACE_NORMALMAP)\n\tvViewPosition=- mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\tvec3 outgoingLight=vec3(0.0);\n\tvec4 diffuseColor=vec4(diffuse, opacity);\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight=diffuseColor.rgb;\n\tgl_FragColor=vec4(outgoingLight, diffuseColor.a);\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize=size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective=isPerspectiveMatrix(projectionMatrix);\n\t\tif(isPerspective) gl_PointSize *=(scale / - mvPosition.z);\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\tgl_FragColor=vec4(color, opacity *(1.0 - getShadowMask()));\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main(){\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\tvec3 outgoingLight=vec3(0.0);\n\tvec4 diffuseColor=vec4(diffuse, opacity);\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight=diffuseColor.rgb;\n\tgl_FragColor=vec4(outgoingLight, diffuseColor.a);\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main(){\n\t#include \n\tvec4 mvPosition=modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);\n\tvec2 scale;\n\tscale.x=length(vec3(modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z));\n\tscale.y=length(vec3(modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z));\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective=isPerspectiveMatrix(projectionMatrix);\n\t\tif(isPerspective) scale *=- mvPosition.z;\n\t#endif\n\tvec2 alignedPosition=(position.xy -(center - vec2(0.5))) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x=cos(rotation) * alignedPosition.x - sin(rotation) * alignedPosition.y;\n\trotatedPosition.y=sin(rotation) * alignedPosition.x + cos(rotation) * alignedPosition.y;\n\tmvPosition.xy +=rotatedPosition;\n\tgl_Position=projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},ni={common:{diffuse:{value:new je(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new ct},uv2Transform:{value:new ct},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new lt(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new je(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new je(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ct}},sprite:{diffuse:{value:new je(15658734)},opacity:{value:1},center:{value:new lt(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new ct}}},ii={basic:{uniforms:Hn([ni.common,ni.specularmap,ni.envmap,ni.aomap,ni.lightmap,ni.fog]),vertexShader:ei.meshbasic_vert,fragmentShader:ei.meshbasic_frag},lambert:{uniforms:Hn([ni.common,ni.specularmap,ni.envmap,ni.aomap,ni.lightmap,ni.emissivemap,ni.fog,ni.lights,{emissive:{value:new je(0)}}]),vertexShader:ei.meshlambert_vert,fragmentShader:ei.meshlambert_frag},phong:{uniforms:Hn([ni.common,ni.specularmap,ni.envmap,ni.aomap,ni.lightmap,ni.emissivemap,ni.bumpmap,ni.normalmap,ni.displacementmap,ni.fog,ni.lights,{emissive:{value:new je(0)},specular:{value:new je(1118481)},shininess:{value:30}}]),vertexShader:ei.meshphong_vert,fragmentShader:ei.meshphong_frag},standard:{uniforms:Hn([ni.common,ni.envmap,ni.aomap,ni.lightmap,ni.emissivemap,ni.bumpmap,ni.normalmap,ni.displacementmap,ni.roughnessmap,ni.metalnessmap,ni.fog,ni.lights,{emissive:{value:new je(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:ei.meshphysical_vert,fragmentShader:ei.meshphysical_frag},toon:{uniforms:Hn([ni.common,ni.aomap,ni.lightmap,ni.emissivemap,ni.bumpmap,ni.normalmap,ni.displacementmap,ni.gradientmap,ni.fog,ni.lights,{emissive:{value:new je(0)}}]),vertexShader:ei.meshtoon_vert,fragmentShader:ei.meshtoon_frag},matcap:{uniforms:Hn([ni.common,ni.bumpmap,ni.normalmap,ni.displacementmap,ni.fog,{matcap:{value:null}}]),vertexShader:ei.meshmatcap_vert,fragmentShader:ei.meshmatcap_frag},points:{uniforms:Hn([ni.points,ni.fog]),vertexShader:ei.points_vert,fragmentShader:ei.points_frag},dashed:{uniforms:Hn([ni.common,ni.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:ei.linedashed_vert,fragmentShader:ei.linedashed_frag},depth:{uniforms:Hn([ni.common,ni.displacementmap]),vertexShader:ei.depth_vert,fragmentShader:ei.depth_frag},normal:{uniforms:Hn([ni.common,ni.bumpmap,ni.normalmap,ni.displacementmap,{opacity:{value:1}}]),vertexShader:ei.normal_vert,fragmentShader:ei.normal_frag},sprite:{uniforms:Hn([ni.sprite,ni.fog]),vertexShader:ei.sprite_vert,fragmentShader:ei.sprite_frag},background:{uniforms:{uvTransform:{value:new ct},t2D:{value:null}},vertexShader:ei.background_vert,fragmentShader:ei.background_frag},cube:{uniforms:Hn([ni.envmap,{opacity:{value:1}}]),vertexShader:ei.cube_vert,fragmentShader:ei.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:ei.equirect_vert,fragmentShader:ei.equirect_frag},distanceRGBA:{uniforms:Hn([ni.common,ni.displacementmap,{referencePosition:{value:new xt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:ei.distanceRGBA_vert,fragmentShader:ei.distanceRGBA_frag},shadow:{uniforms:Hn([ni.lights,ni.fog,{color:{value:new je(0)},opacity:{value:1}}]),vertexShader:ei.shadow_vert,fragmentShader:ei.shadow_frag}};function ri(t,e,n,i,r){const s=new je(0);let a,o,c=0,h=null,u=0,d=null;function p(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,r)}return{getClearColor:function(){return s},setClearColor:function(t,e=1){s.set(t),c=e,p(s,c)},getClearAlpha:function(){return c},setClearAlpha:function(t){c=t,p(s,c)},render:function(n,r,f,m){let g=!0===r.isScene?r.background:null;g&&g.isTexture&&(g=e.get(g));const v=t.xr,y=v.getSession&&v.getSession();y&&"additive"===y.environmentBlendMode&&(g=null),null===g?p(s,c):g&&g.isColor&&(p(g,1),m=!0),(t.autoClear||m)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),g&&(g.isCubeTexture||g.mapping===l)?(void 0===o&&(o=new Bn(new zn(1,1,1),new Gn({name:"BackgroundCubeMaterial",uniforms:Fn(ii.cube.uniforms),vertexShader:ii.cube.vertexShader,fragmentShader:ii.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),o.geometry.deleteAttribute("uv"),o.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(o.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(o)),o.material.uniforms.envMap.value=g,o.material.uniforms.flipEnvMap.value=g.isCubeTexture&&g._needsFlipEnvMap?-1:1,h===g&&u===g.version&&d===t.toneMapping||(o.material.needsUpdate=!0,h=g,u=g.version,d=t.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null)):g&&g.isTexture&&(void 0===a&&(a=new Bn(new ti(2,2),new Gn({name:"BackgroundMaterial",uniforms:Fn(ii.background.uniforms),vertexShader:ii.background.vertexShader,fragmentShader:ii.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(a)),a.material.uniforms.t2D.value=g,!0===g.matrixAutoUpdate&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),h===g&&u===g.version&&d===t.toneMapping||(a.material.needsUpdate=!0,h=g,u=g.version,d=t.toneMapping),n.unshift(a,a.geometry,a.material,0,0,null))}}}function si(t,e,n,i){const r=t.getParameter(34921),s=i.isWebGL2?null:e.get("OES_vertex_array_object"),a=i.isWebGL2||null!==s,o={},l=d(null);let c=l;function h(e){return i.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function u(e){return i.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function d(t){const e=[],n=[],i=[];for(let t=0;t=0){const s=l[e];if(void 0!==s){const e=s.normalized,r=s.itemSize,a=n.get(s);if(void 0===a)continue;const l=a.buffer,c=a.type,h=a.bytesPerElement;if(s.isInterleavedBufferAttribute){const n=s.data,a=n.stride,u=s.offset;n&&n.isInstancedInterleavedBuffer?(m(i,n.meshPerAttribute),void 0===o._maxInstanceCount&&(o._maxInstanceCount=n.meshPerAttribute*n.count)):f(i),t.bindBuffer(34962,l),v(i,r,c,e,a*h,u*h)}else s.isInstancedBufferAttribute?(m(i,s.meshPerAttribute),void 0===o._maxInstanceCount&&(o._maxInstanceCount=s.meshPerAttribute*s.count)):f(i),t.bindBuffer(34962,l),v(i,r,c,e,0,0)}else if("instanceMatrix"===e){const e=n.get(r.instanceMatrix);if(void 0===e)continue;const s=e.buffer,a=e.type;m(i+0,1),m(i+1,1),m(i+2,1),m(i+3,1),t.bindBuffer(34962,s),t.vertexAttribPointer(i+0,4,a,!1,64,0),t.vertexAttribPointer(i+1,4,a,!1,64,16),t.vertexAttribPointer(i+2,4,a,!1,64,32),t.vertexAttribPointer(i+3,4,a,!1,64,48)}else if("instanceColor"===e){const e=n.get(r.instanceColor);if(void 0===e)continue;const s=e.buffer,a=e.type;m(i,1),t.bindBuffer(34962,s),t.vertexAttribPointer(i,3,a,!1,12,0)}else if(void 0!==h){const n=h[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(i,n);break;case 3:t.vertexAttrib3fv(i,n);break;case 4:t.vertexAttrib4fv(i,n);break;default:t.vertexAttrib1fv(i,n)}}}}g()}(r,l,u,y),null!==x&&t.bindBuffer(34963,n.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const t in o){const e=o[t];for(const t in e){const n=e[t];for(const t in n)u(n[t].object),delete n[t];delete e[t]}delete o[t]}},releaseStatesOfGeometry:function(t){if(void 0===o[t.id])return;const e=o[t.id];for(const t in e){const n=e[t];for(const t in n)u(n[t].object),delete n[t];delete e[t]}delete o[t.id]},releaseStatesOfProgram:function(t){for(const e in o){const n=o[e];if(void 0===n[t.id])continue;const i=n[t.id];for(const t in i)u(i[t].object),delete i[t];delete n[t.id]}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:g}}function ai(t,e,n,i){const r=i.isWebGL2;let s;this.setMode=function(t){s=t},this.render=function(e,i){t.drawArrays(s,e,i),n.update(i,s,1)},this.renderInstances=function(i,a,o){if(0===o)return;let l,c;if(r)l=t,c="drawArraysInstanced";else if(l=e.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](s,i,a,o),n.update(a,s,o)}}function oi(t,e,n){let i;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let a=void 0!==n.precision?n.precision:"highp";const o=r(a);o!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o);const l=!0===n.logarithmicDepthBuffer,c=t.getParameter(34930),h=t.getParameter(35660),u=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=h>0,y=s||e.has("OES_texture_float");return{isWebGL2:s,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===e.has("EXT_texture_filter_anisotropic")){const n=e.get("EXT_texture_filter_anisotropic");i=t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:s?t.getParameter(36183):0}}function li(t){const e=this;let n=null,i=0,r=!1,s=!1;const a=new Te,o=new ct,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(t,n,i,r){const s=null!==t?t.length:0;let c=null;if(0!==s){if(c=l.value,!0!==r||null===c){const e=i+4*s,r=n.matrixWorldInverse;o.getNormalMatrix(r),(null===c||c.length0){const a=t.getRenderTarget(),o=new Xn(s.height/2);return o.fromEquirectangularTexture(t,r),e.set(r,o),t.setRenderTarget(a),r.addEventListener("dispose",i),n(o.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}function hi(t){const e={};function n(n){if(void 0!==e[n])return e[n];let i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return e[n]=i,i}return{has:function(t){return null!==n(t)},init:function(t){t.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(t){const e=n(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function ui(t,e,n,i){const r={},s=new WeakMap;function a(t){const o=t.target;null!==o.index&&e.remove(o.index);for(const t in o.attributes)e.remove(o.attributes[t]);o.removeEventListener("dispose",a),delete r[o.id];const l=s.get(o);l&&(e.remove(l),s.delete(o)),i.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(t){const n=[],i=t.index,r=t.attributes.position;let a=0;if(null!==i){const t=i.array;a=i.version;for(let e=0,i=t.length;e65535?nn:tn)(n,1);o.version=a;const l=s.get(t);l&&e.remove(l),s.set(t,o)}return{get:function(t,e){return!0===r[e.id]||(e.addEventListener("dispose",a),r[e.id]=!0,n.memory.geometries++),e},update:function(t){const n=t.attributes;for(const t in n)e.update(n[t],34962);const i=t.morphAttributes;for(const t in i){const n=i[t];for(let t=0,i=n.length;t0)return t;const r=e*n;let s=Si[r];if(void 0===s&&(s=new Float32Array(r),Si[r]=s),0!==e){i.toArray(s,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(s,r)}return s}function Ci(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n/gm;function Ir(t){return t.replace(Dr,Nr)}function Nr(t,e){const n=ei[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Ir(n)}const Br=/#pragma unroll_loop[\s]+?for \(int i \=(\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Or=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function zr(t){return t.replace(Or,Hr).replace(Br,Fr)}function Fr(t,e,n,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Hr(t,e,n,i)}function Hr(t,e,n,i){let r="";for(let t=parseInt(e);t0?t.gammaFactor:1,v=n.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives:enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth:enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers:require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod:enable":""].filter(Rr).join("\n")}(n),y=function(t){const e=[];for(const n in t){const i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}(o),x=a.createProgram();let _,b,w=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(_=[y].filter(Rr).join("\n"),_.length>0&&(_+="\n"),b=[v,y].filter(Rr).join("\n"),b.length>0&&(b+="\n")):(_=[Ur(n),"#define SHADER_NAME "+n.shaderName,y,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+g,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+f:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+d:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined(USE_COLOR_ALPHA)","\tattribute vec4 color;","#elif defined(USE_COLOR)","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Rr).join("\n"),b=[v,Ur(n),"#define SHADER_NAME "+n.shaderName,y,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+g,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+p:"",n.envMap?"#define "+f:"",n.envMap?"#define "+m:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+d:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?ei.tonemapping_pars_fragment:"",0!==n.toneMapping?Lr("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",ei.encodings_pars_fragment,n.map?Er("mapTexelToLinear",n.mapEncoding):"",n.matcap?Er("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?Er("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?Er("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?Er("lightMapTexelToLinear",n.lightMapEncoding):"",Ar("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Rr).join("\n")),h=Ir(h),h=Cr(h,n),h=Pr(h,n),u=Ir(u),u=Cr(u,n),u=Pr(u,n),h=zr(h),u=zr(u),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(w="#version 300 es\n",_=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+_,b=["#define varying in",n.glslVersion===it?"":"out highp vec4 pc_fragColor;",n.glslVersion===it?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+b);const M=w+b+u,S=wr(a,35633,w+_+h),T=wr(a,35632,M);if(a.attachShader(x,S),a.attachShader(x,T),void 0!==n.index0AttributeName?a.bindAttribLocation(x,0,n.index0AttributeName):!0===n.morphTargets&&a.bindAttribLocation(x,0,"position"),a.linkProgram(x),t.debug.checkShaderErrors){const t=a.getProgramInfoLog(x).trim(),e=a.getShaderInfoLog(S).trim(),n=a.getShaderInfoLog(T).trim();let i=!0,r=!0;if(!1===a.getProgramParameter(x,35714)){i=!1;const e=Tr(a,S,"vertex"),n=Tr(a,T,"fragment");console.error("THREE.WebGLProgram: shader error: ",a.getError(),"35715",a.getProgramParameter(x,35715),"gl.getProgramInfoLog",t,e,n)}else""!==t?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",t):""!==e&&""!==n||(r=!1);r&&(this.diagnostics={runnable:i,programLog:t,vertexShader:{log:e,prefix:_},fragmentShader:{log:n,prefix:b}})}let E,A;return a.deleteShader(S),a.deleteShader(T),this.getUniforms=function(){return void 0===E&&(E=new br(a,x)),E},this.getAttributes=function(){return void 0===A&&(A=function(t,e){const n={},i=t.getProgramParameter(e,35721);for(let r=0;r0,maxBones:S,useVertexTexture:u,morphTargets:r.morphTargets,morphNormals:r.morphNormals,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:r.dithering,shadowMapEnabled:t.shadowMap.enabled&&g.length>0,shadowMapType:t.shadowMap.type,toneMapping:r.toneMapped?t.toneMapping:0,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:2===r.side,flipSided:1===r.side,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:o||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:o||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:o||n.has("EXT_shader_texture_lod"),customProgramCacheKey:r.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);if(!1===e.isRawShaderMaterial){for(let t=0;t1&&i.sort(t||Wr),r.length>1&&r.sort(e||jr)}}}function Xr(t){let e=new WeakMap;return{get:function(n,i){let r;return!1===e.has(n)?(r=new qr(t),e.set(n,[r])):i>=e.get(n).length?(r=new qr(t),e.get(n).push(r)):r=e.get(n)[i],r},dispose:function(){e=new WeakMap}}}function Yr(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new xt,color:new je};break;case"SpotLight":n={position:new xt,direction:new xt,color:new je,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new xt,color:new je,distance:0,decay:0};break;case"HemisphereLight":n={direction:new xt,skyColor:new je,groundColor:new je};break;case"RectAreaLight":n={color:new je,position:new xt,halfWidth:new xt,halfHeight:new xt}}return t[e.id]=n,n}}}let Zr=0;function Jr(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Qr(t,e){const n=new Yr,i=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new lt};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new lt,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)r.probe.push(new xt);const s=new xt,a=new Jt,o=new Jt;return{setup:function(s){let a=0,o=0,l=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let c=0,h=0,u=0,d=0,p=0,f=0,m=0,g=0;s.sort(Jr);for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=ni.LTC_FLOAT_1,r.rectAreaLTC2=ni.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=ni.LTC_HALF_1,r.rectAreaLTC2=ni.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=a,r.ambient[1]=o,r.ambient[2]=l;const v=r.hash;v.directionalLength===c&&v.pointLength===h&&v.spotLength===u&&v.rectAreaLength===d&&v.hemiLength===p&&v.numDirectionalShadows===f&&v.numPointShadows===m&&v.numSpotShadows===g||(r.directional.length=c,r.spot.length=u,r.rectArea.length=d,r.point.length=h,r.hemi.length=p,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=g,r.spotShadowMap.length=g,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=m,r.spotShadowMatrix.length=g,v.directionalLength=c,v.pointLength=h,v.spotLength=u,v.rectAreaLength=d,v.hemiLength=p,v.numDirectionalShadows=f,v.numPointShadows=m,v.numSpotShadows=g,r.version=Zr++)},setupView:function(t,e){let n=0,i=0,l=0,c=0,h=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=n.get(i).length?(s=new Kr(t,e),n.get(i).push(s)):s=n.get(i)[r],s},dispose:function(){n=new WeakMap}}}class ts extends Fe{constructor(t){super(),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}}ts.prototype.isMeshDepthMaterial=!0;class es extends Fe{constructor(t){super(),this.type="MeshDistanceMaterial",this.referencePosition=new xt,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}es.prototype.isMeshDistanceMaterial=!0;function ns(t,e,n){let i=new Qn;const r=new lt,s=new lt,a=new mt,o=[],l=[],c={},h=n.maxTextureSize,u={0:1,1:0,2:2},d=new Gn({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new lt},radius:{value:4}},vertexShader:"void main(){\n\tgl_Position=vec4(position, 1.0);\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main(){\n\tfloat mean=0.0;\n\tfloat squared_mean=0.0;\n\tfloat depth=unpackRGBAToDepth(texture2D(shadow_pass,(gl_FragCoord.xy) / resolution));\n\tfor(float i=-1.0; i < 1.0 ; i +=SAMPLE_RATE){\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution=unpackRGBATo2Half(texture2D(shadow_pass,(gl_FragCoord.xy + vec2(i, 0.0) * radius) / resolution));\n\t\t\tmean +=distribution.x;\n\t\t\tsquared_mean +=distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth=unpackRGBAToDepth(texture2D(shadow_pass,(gl_FragCoord.xy + vec2(0.0, i) * radius) / resolution));\n\t\t\tmean +=depth;\n\t\t\tsquared_mean +=depth * depth;\n\t\t#endif\n\t}\n\tmean=mean * HALF_SAMPLE_RATE;\n\tsquared_mean=squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev=sqrt(squared_mean - mean * mean);\n\tgl_FragColor=pack2HalfToRGBA(vec2(mean, std_dev));\n}"}),f=d.clone();f.defines.HORIZONTAL_PASS=1;const m=new vn;m.setAttribute("position",new Ze(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const v=new Bn(m,d),y=this;function x(n,i){const r=e.update(v);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,r,d,v,null),f.uniforms.shadow_pass.value=n.mapPass.texture,f.uniforms.resolution.value=n.mapSize,f.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,r,f,v,null)}function _(t,e,n){const i=t<<0|e<<1|n<<2;let r=o[i];return void 0===r&&(r=new ts({depthPacking:3201,morphTargets:t,skinning:e}),o[i]=r),r}function b(t,e,n){const i=t<<0|e<<1|n<<2;let r=l[i];return void 0===r&&(r=new es({morphTargets:t,skinning:e}),l[i]=r),r}function w(e,n,i,r,s,a,o){let l=null,h=_,d=e.customDepthMaterial;if(!0===r.isPointLight&&(h=b,d=e.customDistanceMaterial),void 0===d){let t=!1;!0===i.morphTargets&&(t=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let r=!1;!0===e.isSkinnedMesh&&(!0===i.skinning?r=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e));l=h(t,r,!0===e.isInstancedMesh)}else l=d;if(t.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length){const t=l.uuid,e=i.uuid;let n=c[t];void 0===n&&(n={},c[t]=n);let r=n[e];void 0===r&&(r=l.clone(),n[e]=r),l=r}return l.visible=i.visible,l.wireframe=i.wireframe,l.side=3===o?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:u[i.side],l.clipShadows=i.clipShadows,l.clippingPlanes=i.clippingPlanes,l.clipIntersection=i.clipIntersection,l.wireframeLinewidth=i.wireframeLinewidth,l.linewidth=i.linewidth,!0===r.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(r.matrixWorld),l.nearDistance=s,l.farDistance=a),l}function M(n,r,s,a,o){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===o)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const i=e.update(n),r=n.material;if(Array.isArray(r)){const e=i.groups;for(let l=0,c=e.length;lh||r.y>h)&&(r.x>h&&(s.x=Math.floor(h/f.x),r.x=s.x*f.x,u.mapSize.x=s.x),r.y>h&&(s.y=Math.floor(h/f.y),r.y=s.y*f.y,u.mapSize.y=s.y)),null===u.map&&!u.isPointLightShadow&&3===this.type){const t={minFilter:g,magFilter:g,format:E};u.map=new gt(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.mapPass=new gt(r.x,r.y,t),u.camera.updateProjectionMatrix()}if(null===u.map){const t={minFilter:p,magFilter:p,format:E};u.map=new gt(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const m=u.getViewportCount();for(let t=0;t=1):-1!==R.indexOf("OpenGL ES")&&(L=parseFloat(/^OpenGL ES (\d)/.exec(R)[1]),A=L>=2);let C=null,P={};const D=new mt(0,0,t.canvas.width,t.canvas.height),I=new mt(0,0,t.canvas.width,t.canvas.height);function N(e,n,i){const r=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;ei||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const i=e?ot.floorPowerOfTwo:Math.floor,s=i(r*t.width),a=i(r*t.height);void 0===P&&(P=I(s,a));const o=n?I(s,a):P;o.width=s,o.height=a;return o.getContext("2d").drawImage(t,0,0,s,a),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+a+")."),o}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function B(t){return ot.isPowerOfTwo(t.width)&&ot.isPowerOfTwo(t.height)}function O(t,e){return t.generateMipmaps&&e&&t.minFilter!==p&&t.minFilter!==g}function z(e,n,r,s){t.generateMipmap(e);i.get(n).__maxMipLevel=Math.log2(Math.max(r,s))}function F(n,i,r){if(!1===o)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let s=i;return 6403===i&&(5126===r&&(s=33326),5131===r&&(s=33325),5121===r&&(s=33321)),6407===i&&(5126===r&&(s=34837),5131===r&&(s=34843),5121===r&&(s=32849)),6408===i&&(5126===r&&(s=34836),5131===r&&(s=34842),5121===r&&(s=32856)),33325!==s&&33326!==s&&34842!==s&&34836!==s||e.get("EXT_color_buffer_float"),s}function H(t){return t===p||t===f||t===m?9728:9729}function U(e){const n=e.target;n.removeEventListener("dispose",U),function(e){const n=i.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),i.remove(e)}(n),n.isVideoTexture&&C.delete(n),a.memory.textures--}function G(e){const n=e.target;n.removeEventListener("dispose",G),function(e){const n=e.texture,r=i.get(e),s=i.get(n);if(!e)return;void 0!==s.__webglTexture&&t.deleteTexture(s.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&t.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer);i.remove(n),i.remove(e)}(n),a.memory.textures--}let k=0;function V(t,e){const r=i.get(t);if(t.isVideoTexture&&function(t){const e=a.render.frame;C.get(t)!==e&&(C.set(t,e),t.update())}(t),t.version>0&&r.__version!==t.version){const n=t.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void Z(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,r.__webglTexture)}function W(e,r){const a=i.get(e);e.version>0&&a.__version!==e.version?function(e,i,r){if(6!==i.image.length)return;Y(e,i),n.activeTexture(33984+r),n.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment),t.pixelStorei(37443,0);const a=i&&(i.isCompressedTexture||i.image[0].isCompressedTexture),l=i.image[0]&&i.image[0].isDataTexture,h=[];for(let t=0;t<6;t++)h[t]=a||l?l?i.image[t].image:i.image[t]:N(i.image[t],!1,!0,c);const u=h[0],d=B(u)||o,p=s.convert(i.format),f=s.convert(i.type),m=F(i.internalFormat,p,f);let g;if(X(34067,i,d),a){for(let t=0;t<6;t++){g=h[t].mipmaps;for(let e=0;e1||i.get(s).__currentAnisotropy)&&(t.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),i.get(s).__currentAnisotropy=s.anisotropy)}}function Y(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",U),e.__webglTexture=t.createTexture(),a.memory.textures++)}function Z(e,i,r){let a=3553;i.isDataTexture2DArray&&(a=35866),i.isDataTexture3D&&(a=32879),Y(e,i),n.activeTexture(33984+r),n.bindTexture(a,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment),t.pixelStorei(37443,0);const l=function(t){return!o&&(t.wrapS!==u||t.wrapT!==u||t.minFilter!==p&&t.minFilter!==g)}(i)&&!1===B(i.image),c=N(i.image,l,!1,x),h=B(c)||o,d=s.convert(i.format);let f,m=s.convert(i.type),v=F(i.internalFormat,d,m);X(a,i,h);const y=i.mipmaps;if(i.isDepthTexture)v=6402,o?v=i.type===w?36012:i.type===b?33190:i.type===S?35056:33189:i.type===w&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===A&&6402===v&&i.type!==_&&i.type!==b&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=_,m=s.convert(i.type)),i.format===L&&6402===v&&(v=34041,i.type!==S&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=S,m=s.convert(i.type))),n.texImage2D(3553,0,v,c.width,c.height,0,d,m,null);else if(i.isDataTexture)if(y.length>0&&h){for(let t=0,e=y.length;t0&&h){for(let t=0,e=y.length;t=l&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+l),k+=1,t},this.resetTextureUnits=function(){k=0},this.setTexture2D=V,this.setTexture2DArray=function(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?Z(r,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?Z(r,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=W,this.setupRenderTarget=function(e){const r=e.texture,l=i.get(e),c=i.get(r);e.addEventListener("dispose",G),c.__webglTexture=t.createTexture(),c.__version=r.version,a.memory.textures++;const h=!0===e.isWebGLCubeRenderTarget,u=!0===e.isWebGLMultisampleRenderTarget,d=r.isDataTexture3D||r.isDataTexture2DArray,p=B(e)||o;if(!o||r.format!==T||r.type!==w&&r.type!==M||(r.format=E,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),h){l.__webglFramebuffer=[];for(let e=0;e<6;e++)l.__webglFramebuffer[e]=t.createFramebuffer()}else if(l.__webglFramebuffer=t.createFramebuffer(),u)if(o){l.__webglMultisampledFramebuffer=t.createFramebuffer(),l.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,l.__webglColorRenderbuffer);const i=s.convert(r.format),a=s.convert(r.type),o=F(r.internalFormat,i,a),c=$(e);t.renderbufferStorageMultisample(36161,c,o,e.width,e.height),n.bindFramebuffer(36160,l.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,l.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(l.__webglDepthRenderbuffer=t.createRenderbuffer(),Q(l.__webglDepthRenderbuffer,e,!0)),n.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(h){n.bindTexture(34067,c.__webglTexture),X(34067,r,p);for(let t=0;t<6;t++)J(l.__webglFramebuffer[t],e,36064,34069+t);O(r,p)&&z(34067,r,e.width,e.height),n.bindTexture(34067,null)}else{let t=3553;if(d)if(o){t=r.isDataTexture3D?32879:35866}else console.warn("THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.");n.bindTexture(t,c.__webglTexture),X(t,r,p),J(l.__webglFramebuffer,e,36064,t),O(r,p)&&z(3553,r,e.width,e.height),n.bindTexture(3553,null)}e.depthBuffer&&K(e)},this.updateRenderTargetMipmap=function(t){const e=t.texture;if(O(e,B(t)||o)){const r=t.isWebGLCubeRenderTarget?34067:3553,s=i.get(e).__webglTexture;n.bindTexture(r,s),z(r,e,t.width,t.height),n.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(o){const r=i.get(e);n.bindFramebuffer(36008,r.__webglMultisampledFramebuffer),n.bindFramebuffer(36009,r.__webglFramebuffer);const s=e.width,a=e.height;let o=16384;e.depthBuffer&&(o|=256),e.stencilBuffer&&(o|=1024),t.blitFramebuffer(0,0,s,a,0,0,s,a,o,9728),n.bindFramebuffer(36160,r.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===tt&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),tt=!0),t=t.texture),V(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===et&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),et=!0),t=t.texture),W(t,e)}}function ss(t,e,n){const i=n.isWebGL2;return{convert:function(t){let n;if(t===x)return 5121;if(1017===t)return 32819;if(1018===t)return 32820;if(1019===t)return 33635;if(1010===t)return 5120;if(1011===t)return 5122;if(t===_)return 5123;if(1013===t)return 5124;if(t===b)return 5125;if(t===w)return 5126;if(t===M)return i?5131:(n=e.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(1021===t)return 6406;if(t===T)return 6407;if(t===E)return 6408;if(1024===t)return 6409;if(1025===t)return 6410;if(t===A)return 6402;if(t===L)return 34041;if(1028===t)return 6403;if(1029===t)return 36244;if(1030===t)return 33319;if(1031===t)return 33320;if(1032===t)return 36248;if(1033===t)return 36249;if(t===R||t===C||t===P||t===D){if(n=e.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(t===R)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===C)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===P)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===D)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===I||t===N||t===B||t===O){if(n=e.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(t===I)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===N)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===B)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===O)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===t)return n=e.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===z||t===F)&&(n=e.get("WEBGL_compressed_texture_etc"),null!==n)){if(t===z)return n.COMPRESSED_RGB8_ETC2;if(t===F)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===t||37809===t||37810===t||37811===t||37812===t||37813===t||37814===t||37815===t||37816===t||37817===t||37818===t||37819===t||37820===t||37821===t||37840===t||37841===t||37842===t||37843===t||37844===t||37845===t||37846===t||37847===t||37848===t||37849===t||37850===t||37851===t||37852===t||37853===t?(n=e.get("WEBGL_compressed_texture_astc"),null!==n?t:null):36492===t?(n=e.get("EXT_texture_compression_bptc"),null!==n?t:null):t===S?i?34042:(n=e.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}class as extends Vn{constructor(t=[]){super(),this.cameras=t}}as.prototype.isArrayCamera=!0;class os extends be{constructor(){super(),this.type="Group"}}function ls(){this._targetRay=null,this._grip=null,this._hand=null}function cs(t,e){const n=this,i=t.state;let r=null,s=1,a=null,o="local-floor",l=null;const c=[],h=new Map,u=new Vn;u.layers.enable(1),u.viewport=new mt;const d=new Vn;d.layers.enable(2),d.viewport=new mt;const p=[u,d],f=new as;f.layers.enable(1),f.layers.enable(2);let m=null,g=null;function v(t){const e=h.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function y(){h.forEach((function(t,e){t.disconnect(e)})),h.clear(),m=null,g=null,i.bindXRFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),S.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function x(t){const e=r.inputSources;for(let t=0;t0&&Rt(s,t,e),a.length>0&&Rt(a,t,e),null!==_&&(J.updateRenderTargetMipmap(_),J.updateMultisampleRenderTarget(_)),!0===t.isScene&&t.onAfterRender(m,t,e),q.buffers.depth.setTest(!0),q.buffers.depth.setMask(!0),q.buffers.color.setMask(!0),q.setPolygonOffset(!1),ft.resetDefaultState(),b=-1,S=null,f.pop(),d=f.length>0?f[f.length-1]:null,p.pop(),u=p.length>0?p[p.length-1]:null},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderTarget=function(){return _},this.setRenderTarget=function(t,e=0,n=0){_=t,v=e,y=n,t&&void 0===Z.get(t).__webglFramebuffer&&J.setupRenderTarget(t);let i=null,r=!1,s=!1;if(t){const n=t.texture;(n.isDataTexture3D||n.isDataTexture2DArray)&&(s=!0);const a=Z.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=a[e],r=!0):i=t.isWebGLMultisampleRenderTarget?Z.get(t).__webglMultisampledFramebuffer:a,T.copy(t.viewport),A.copy(t.scissor),L=t.scissorTest}else T.copy(N).multiplyScalar(P).floor(),A.copy(B).multiplyScalar(P).floor(),L=O;if(q.bindFramebuffer(36160,i),q.viewport(T),q.scissor(A),q.setScissorTest(L),r){const i=Z.get(t.texture);gt.framebufferTexture2D(36160,36064,34069+e,i.__webglTexture,n)}else if(s){const i=Z.get(t.texture),r=e||0;gt.framebufferTextureLayer(36160,36064,i.__webglTexture,n||0,r)}},this.readRenderTargetPixels=function(t,e,n,i,r,s,a){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let o=Z.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==a&&(o=o[a]),o){q.bindFramebuffer(36160,o);try{const a=t.texture,o=a.format,l=a.type;if(o!==E&&pt.convert(o)!==gt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===M&&(W.has("EXT_color_buffer_half_float")||j.isWebGL2&&W.has("EXT_color_buffer_float"));if(!(l===x||pt.convert(l)===gt.getParameter(35738)||l===w&&(j.isWebGL2||W.has("OES_texture_float")||W.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===gt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&>.readPixels(e,n,i,r,pt.convert(o),pt.convert(l),s):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{const t=null!==_?Z.get(_).__webglFramebuffer:null;q.bindFramebuffer(36160,t)}}},this.copyFramebufferToTexture=function(t,e,n=0){const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),s=Math.floor(e.image.height*i),a=pt.convert(e.format);J.setTexture2D(e,0),gt.copyTexImage2D(3553,n,a,t.x,t.y,r,s,0),q.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i=0){const r=e.image.width,s=e.image.height,a=pt.convert(n.format),o=pt.convert(n.type);J.setTexture2D(n,0),gt.pixelStorei(37440,n.flipY),gt.pixelStorei(37441,n.premultiplyAlpha),gt.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?gt.texSubImage2D(3553,i,t.x,t.y,r,s,a,o,e.image.data):e.isCompressedTexture?gt.compressedTexSubImage2D(3553,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,a,e.mipmaps[0].data):gt.texSubImage2D(3553,i,t.x,t.y,a,o,e.image),0===i&&n.generateMipmaps&>.generateMipmap(3553),q.unbindTexture()},this.copyTextureToTexture3D=function(t,e,n,i,r=0){if(m.isWebGL1Renderer)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");const{width:s,height:a,data:o}=n.image,l=pt.convert(i.format),c=pt.convert(i.type);let h;if(i.isDataTexture3D)J.setTexture3D(i,0),h=32879;else{if(!i.isDataTexture2DArray)return void console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");J.setTexture2DArray(i,0),h=35866}gt.pixelStorei(37440,i.flipY),gt.pixelStorei(37441,i.premultiplyAlpha),gt.pixelStorei(3317,i.unpackAlignment);const u=gt.getParameter(3314),d=gt.getParameter(32878),p=gt.getParameter(3316),f=gt.getParameter(3315),g=gt.getParameter(32877);gt.pixelStorei(3314,s),gt.pixelStorei(32878,a),gt.pixelStorei(3316,t.min.x),gt.pixelStorei(3315,t.min.y),gt.pixelStorei(32877,t.min.z),gt.texSubImage3D(h,r,e.x,e.y,e.z,t.max.x-t.min.x+1,t.max.y-t.min.y+1,t.max.z-t.min.z+1,l,c,o),gt.pixelStorei(3314,u),gt.pixelStorei(32878,d),gt.pixelStorei(3316,p),gt.pixelStorei(3315,f),gt.pixelStorei(32877,g),0===r&&i.generateMipmaps&>.generateMipmap(h),q.unbindTexture()},this.initTexture=function(t){J.setTexture2D(t,0),q.unbindTexture()},this.resetState=function(){v=0,y=0,_=null,q.reset(),ft.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}os.prototype.isGroup=!0,Object.assign(ls.prototype,{constructor:ls,getHandSpace:function(){return null===this._hand&&(this._hand=new os,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new os,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new os,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(t,e,n){let i=null,r=null,s=null;const a=this._targetRay,o=this._grip,l=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(null!==a&&(i=e.getPose(t.targetRaySpace,n),null!==i&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale))),l&&t.hand){s=!0;for(const i of t.hand.values()){const t=e.getJointPose(i,n);if(void 0===l.joints[i.jointName]){const t=new os;t.matrixAutoUpdate=!1,t.visible=!1,l.joints[i.jointName]=t,l.add(t)}const r=l.joints[i.jointName];null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=t.radius),r.visible=null!==t}const i=l.joints["index-finger-tip"],r=l.joints["thumb-tip"],a=i.position.distanceTo(r.position),o=.02,c=.005;l.inputState.pinching&&a>o+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!l.inputState.pinching&&a<=o-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&t.gripSpace&&(r=e.getPose(t.gripSpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale)));return null!==a&&(a.visible=null!==i),null!==o&&(o.visible=null!==r),null!==l&&(l.visible=null!==s),this}}),Object.assign(cs.prototype,rt.prototype);class ds extends us{}ds.prototype.isWebGL1Renderer=!0;class ps{constructor(t,e=25e-5){this.name="",this.color=new je(t),this.density=e}clone(){return new ps(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}ps.prototype.isFogExp2=!0;class fs{constructor(t,e=1,n=1e3){this.name="",this.color=new je(t),this.near=e,this.far=n}clone(){return new fs(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}fs.prototype.isFog=!0;class ms extends be{constructor(){super(),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}function gs(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=et,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=ot.generateUUID()}ms.prototype.isScene=!0,Object.defineProperty(gs.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(gs.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;it.far||e.push({distance:o,point:bs.clone(),uv:Oe.getUV(bs,As,Ls,Rs,Cs,Ps,Ds,new lt),face:null,object:this})}copy(t){return super.copy(t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function Ns(t,e,n,i,r,s){Ss.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(Ts.x=s*Ss.x-r*Ss.y,Ts.y=r*Ss.x+s*Ss.y):Ts.copy(Ss),t.copy(e),t.x+=Ts.x,t.y+=Ts.y,t.applyMatrix4(Es)}Is.prototype.isSprite=!0;const Bs=new xt,Os=new xt;class zs extends be{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,n=e.length;t0){let n,i;for(n=1,i=e.length;n0){Bs.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(Bs);this.getObjectForDistance(n).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){Bs.setFromMatrixPosition(t.matrixWorld),Os.setFromMatrixPosition(this.matrixWorld);const n=Bs.distanceTo(Os)/t.zoom;let i,r;for(e[0].object.visible=!0,i=1,r=e.length;i=e[i].distance;i++)e[i-1].object.visible=!1,e[i].object.visible=!0;for(this._currentLevel=i-1;io)continue;u.applyMatrix4(this.matrixWorld);const d=t.ray.origin.distanceTo(u);dt.far||e.push({distance:d,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else{for(let n=Math.max(0,s.start),i=Math.min(r.count,s.start+s.count)-1;no)continue;u.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(u);it.far||e.push({distance:i,point:h.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const aa=new xt,oa=new xt;function la(t,e){sa.call(this,t,e),this.type="LineSegments"}la.prototype=Object.assign(Object.create(sa.prototype),{constructor:la,isLineSegments:!0,computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,i=e.count;tr.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:e,face:null,object:a})}}ma.prototype=Object.assign(Object.create(be.prototype),{constructor:ma,isPoints:!0,copy:function(t){return be.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},raycast:function(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),pa.copy(n.boundingSphere),pa.applyMatrix4(i),pa.radius+=r,!1===t.ray.intersectsSphere(pa))return;ua.copy(i).invert(),da.copy(t.ray).applyMatrix4(ua);const a=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){const r=n.index,a=n.attributes.position;if(null!==r){for(let n=Math.max(0,s.start),l=Math.min(r.count,s.start+s.count);n0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});class va extends pt{constructor(t,e,n,i,r,s,a,o,l){super(t,e,n,i,r,s,a,o,l),this.format=void 0!==a?a:T,this.minFilter=void 0!==s?s:g,this.magFilter=void 0!==r?r:g,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){c.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}va.prototype.isVideoTexture=!0;class ya extends pt{constructor(t,e,n,i,r,s,a,o,l,c,h,u){super(null,s,a,o,l,c,i,r,h,u),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}ya.prototype.isCompressedTexture=!0;class xa extends pt{constructor(t,e,n,i,r,s,a,o,l){super(t,e,n,i,r,s,a,o,l),this.needsUpdate=!0}}xa.prototype.isCanvasTexture=!0;class _a extends pt{constructor(t,e,n,i,r,s,a,o,l,c){if((c=void 0!==c?c:A)!==A&&c!==L)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&c===A&&(n=_),void 0===n&&c===L&&(n=S),super(null,i,r,s,a,o,c,n,l),this.image={width:t,height:e},this.magFilter=void 0!==a?a:p,this.minFilter=void 0!==o?o:p,this.flipY=!1,this.generateMipmaps=!1}}_a.prototype.isDepthTexture=!0;class ba extends vn{constructor(t=1,e=8,n=0,i=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},e=Math.max(3,e);const r=[],s=[],a=[],o=[],l=new xt,c=new lt;s.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let r=0,h=3;r<=e;r++,h+=3){const u=n+r/e*i;l.x=t*Math.cos(u),l.y=t*Math.sin(u),s.push(l.x,l.y,l.z),a.push(0,0,1),c.x=(s[h]/t+1)/2,c.y=(s[h+1]/t+1)/2,o.push(c.x,c.y)}for(let t=1;t<=e;t++)r.push(t,t+1,0);this.setIndex(r),this.setAttribute("position",new sn(s,3)),this.setAttribute("normal",new sn(a,3)),this.setAttribute("uv",new sn(o,2))}}class wa extends vn{constructor(t=1,e=1,n=1,i=8,r=1,s=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:s,thetaStart:a,thetaLength:o};const l=this;i=Math.floor(i),r=Math.floor(r);const c=[],h=[],u=[],d=[];let p=0;const f=[],m=n/2;let g=0;function v(n){const r=p,s=new lt,f=new xt;let v=0;const y=!0===n?t:e,x=!0===n?1:-1;for(let t=1;t<=i;t++)h.push(0,m*x,0),u.push(0,x,0),d.push(.5,.5),p++;const _=p;for(let t=0;t<=i;t++){const e=t/i*o+a,n=Math.cos(e),r=Math.sin(e);f.x=y*r,f.y=m*x,f.z=y*n,h.push(f.x,f.y,f.z),u.push(0,x,0),s.x=.5*n+.5,s.y=.5*r*x+.5,d.push(s.x,s.y),p++}for(let t=0;t0&&v(!0),e>0&&v(!1)),this.setIndex(c),this.setAttribute("position",new sn(h,3)),this.setAttribute("normal",new sn(u,3)),this.setAttribute("uv",new sn(d,2))}}class Ma extends wa{constructor(t=1,e=1,n=8,i=1,r=!1,s=0,a=2*Math.PI){super(0,t,e,n,i,r,s,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:s,thetaLength:a}}}class Sa extends vn{constructor(t,e,n=1,i=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i};const r=[],s=[];function a(t,e,n,i){const r=i+1,s=[];for(let i=0;i<=r;i++){s[i]=[];const a=t.clone().lerp(n,i/r),o=e.clone().lerp(n,i/r),l=r-i;for(let t=0;t<=l;t++)s[i][t]=0===t&&i===r?a:a.clone().lerp(o,t/l)}for(let t=0;t.9&&a<.1&&(e<.2&&(s[t+0]+=1),n<.2&&(s[t+2]+=1),i<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new sn(r,3)),this.setAttribute("normal",new sn(r.slice(),3)),this.setAttribute("uv",new sn(s,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}}class Ta extends Sa{constructor(t=1,e=0){const n=(1+Math.sqrt(5))/2,i=1/n;super([-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e}}}const Ea=new xt,Aa=new xt,La=new xt,Ra=new Oe;class Ca extends vn{constructor(t,e){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1,!0===t.isGeometry)return void console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const n=Math.pow(10,4),i=Math.cos(ot.DEG2RAD*e),r=t.getIndex(),s=t.getAttribute("position"),a=r?r.count:s.count,o=[0,0,0],l=["a","b","c"],c=new Array(3),h={},u=[];for(let t=0;t80*n){o=c=t[0],l=h=t[1];for(let e=n;ec&&(c=u),d>h&&(h=d);p=Math.max(c-o,h-l),p=0!==p?1/p:0}return Na(s,a,n,o,l,p),a};function Da(t,e,n,i,r){let s,a;if(r===function(t,e,n,i){let r=0;for(let s=e,a=n-i;s0)for(s=e;s=e;s-=i)a=$a(s,t[s],t[s+1],a);return a&&Xa(a,a.next)&&(to(a),a=a.next),a}function Ia(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!Xa(i,i.next)&&0!==qa(i.prev,i,i.next))i=i.next;else{if(to(i),i=e=i.prev,i===i.next)break;n=!0}}while(n||i!==e);return e}function Na(t,e,n,i,r,s,a){if(!t)return;!a&&s&&function(t,e,n,i){let r=t;do{null===r.z&&(r.z=ka(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,n,i,r,s,a,o,l,c=1;do{for(n=t,t=null,s=null,a=0;n;){for(a++,i=n,o=0,e=0;e0||l>0&&i;)0!==o&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,o--):(r=i,i=i.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;n=i}s.nextZ=null,c*=2}while(a>1)}(r)}(t,i,r,s);let o,l,c=t;for(;t.prev!==t.next;)if(o=t.prev,l=t.next,s?Oa(t,i,r,s):Ba(t))e.push(o.i/n),e.push(t.i/n),e.push(l.i/n),to(t),t=l.next,c=l.next;else if((t=l)===c){a?1===a?Na(t=za(Ia(t),e,n),e,n,i,r,s,2):2===a&&Fa(t,e,n,i,r,s):Na(Ia(t),e,n,i,r,s,1);break}}function Ba(t){const e=t.prev,n=t,i=t.next;if(qa(e,n,i)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(Wa(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&qa(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Oa(t,e,n,i){const r=t.prev,s=t,a=t.next;if(qa(r,s,a)>=0)return!1;const o=r.xs.x?r.x>a.x?r.x:a.x:s.x>a.x?s.x:a.x,h=r.y>s.y?r.y>a.y?r.y:a.y:s.y>a.y?s.y:a.y,u=ka(o,l,e,n,i),d=ka(c,h,e,n,i);let p=t.prevZ,f=t.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&Wa(r.x,r.y,s.x,s.y,a.x,a.y,p.x,p.y)&&qa(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&Wa(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&qa(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&Wa(r.x,r.y,s.x,s.y,a.x,a.y,p.x,p.y)&&qa(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&Wa(r.x,r.y,s.x,s.y,a.x,a.y,f.x,f.y)&&qa(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function za(t,e,n){let i=t;do{const r=i.prev,s=i.next.next;!Xa(r,s)&&Ya(r,i,i.next,s)&&Qa(r,s)&&Qa(s,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(s.i/n),to(i),to(i.next),i=t=s),i=i.next}while(i!==t);return Ia(i)}function Fa(t,e,n,i,r,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&ja(a,t)){let o=Ka(a,t);return a=Ia(a,a.next),o=Ia(o,o.next),Na(a,e,n,i,r,s),void Na(o,e,n,i,r,s)}t=t.next}a=a.next}while(a!==t)}function Ha(t,e){return t.x-e.x}function Ua(t,e){if(e=function(t,e){let n=e;const i=t.x,r=t.y;let s,a=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const t=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=i&&t>a){if(a=t,t===i){if(r===n.y)return n;if(r===n.next.y)return n.next}s=n.x=n.x&&n.x>=l&&i!==n.x&&Wa(rs.x||n.x===s.x&&Ga(s,n)))&&(s=n,u=h)),n=n.next}while(n!==o);return s}(t,e)){const n=Ka(e,t);Ia(e,e.next),Ia(n,n.next)}}function Ga(t,e){return qa(t.prev,t,e.prev)<0&&qa(e.next,t,t.next)<0}function ka(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Va(t){let e=t,n=t;do{(e.x=0&&(t-a)*(i-o)-(n-a)*(e-o)>=0&&(n-a)*(s-o)-(r-a)*(i-o)>=0}function ja(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Ya(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Qa(t,e)&&Qa(e,t)&&function(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(qa(t.prev,t,e.prev)||qa(t,e.prev,e))||Xa(t,e)&&qa(t.prev,t,t.next)>0&&qa(e.prev,e,e.next)>0)}function qa(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Xa(t,e){return t.x===e.x&&t.y===e.y}function Ya(t,e,n,i){const r=Ja(qa(t,e,n)),s=Ja(qa(t,e,i)),a=Ja(qa(n,i,t)),o=Ja(qa(n,i,e));return r!==s&&a!==o||(!(0!==r||!Za(t,n,e))||(!(0!==s||!Za(t,i,e))||(!(0!==a||!Za(n,t,i))||!(0!==o||!Za(n,e,i)))))}function Za(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Ja(t){return t>0?1:t<0?-1:0}function Qa(t,e){return qa(t.prev,t,t.next)<0?qa(t,e,t.next)>=0&&qa(t,t.prev,e)>=0:qa(t,e,t.prev)<0||qa(t,t.next,e)<0}function Ka(t,e){const n=new eo(t.i,t.x,t.y),i=new eo(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function $a(t,e,n,i){const r=new eo(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function to(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function eo(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}const no={area:function(t){const e=t.length;let n=0;for(let i=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function ro(t,e){for(let n=0;nNumber.EPSILON){const u=Math.sqrt(h),d=Math.sqrt(l*l+c*c),p=e.x-o/u,f=e.y+a/u,m=((n.x-c/d-p)*c-(n.y+l/d-f)*l)/(a*c-o*l);i=p+a*m-t.x,r=f+o*m-t.y;const g=i*i+r*r;if(g<=2)return new lt(i,r);s=Math.sqrt(g/2)}else{let t=!1;a>Number.EPSILON?l>Number.EPSILON&&(t=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(t=!0):Math.sign(o)===Math.sign(c)&&(t=!0),t?(i=-o,r=a,s=Math.sqrt(h)):(i=a,r=o,s=Math.sqrt(h/2))}return new lt(i/s,r/s)}const P=[];for(let t=0,e=E.length,n=e-1,i=t+1;t=0;t--){const e=t/p,n=h*Math.cos(e*Math.PI/2),i=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=E.length;t=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=o+2*p;t=0?(t(i-o,p,h),u.subVectors(c,h)):(t(i+o,p,h),u.subVectors(h,c)),p-o>=0?(t(i,p-o,h),d.subVectors(c,h)):(t(i,p+o,h),d.subVectors(h,c)),l.crossVectors(u,d).normalize(),s.push(l.x,l.y,l.z),a.push(i,p)}}for(let t=0;t0)&&d.push(e,r,l),(t!==n-1||o=i)){l.push(e.times[t]);for(let n=0;ns.tracks[t].times[0]&&(o=s.tracks[t].times[0]);for(let t=0;t=i.times[u]){const t=u*l+o,e=t+l-o;d=Io.arraySlice(i.values,t,e)}else{const t=i.createInterpolant(),e=o,n=l-o;t.evaluate(s),d=Io.arraySlice(t.resultBuffer,e,n)}if("quaternion"===r){(new yt).fromArray(d).normalize().conjugate().toArray(d)}const p=a.times.length;for(let t=0;t=r)break t;{const a=e[1];t=r)break e}s=n,n=0}}for(;n>>1;te;)--s;if(++s,0!==r||s!==i){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=Io.arraySlice(n,r,s),this.values=Io.arraySlice(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const i=n[e];if("number"==typeof i&&isNaN(i)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,i),t=!1;break}if(null!==s&&s>i){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,i,s),t=!1;break}s=i}if(void 0!==i&&Io.isTypedArray(i))for(let e=0,n=i.length;e!==n;++e){const n=i[e];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,n),t=!1;break}}return t}optimize(){const t=Io.arraySlice(this.times),e=Io.arraySlice(this.values),n=this.getValueSize(),i=this.getInterpolation()===G,r=t.length-1;let s=1;for(let a=1;a0){t[s]=t[r];for(let t=r*n,i=s*n,a=0;a!==n;++a)e[i+a]=e[t+a];++s}return s!==t.length?(this.times=Io.arraySlice(t,0,s),this.values=Io.arraySlice(e,0,s*n)):(this.times=t,this.values=e),this}clone(){const t=Io.arraySlice(this.times,0),e=Io.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}Fo.prototype.TimeBufferType=Float32Array,Fo.prototype.ValueBufferType=Float32Array,Fo.prototype.DefaultInterpolation=U;class Ho extends Fo{}Ho.prototype.ValueTypeName="bool",Ho.prototype.ValueBufferType=Array,Ho.prototype.DefaultInterpolation=H,Ho.prototype.InterpolantFactoryMethodLinear=void 0,Ho.prototype.InterpolantFactoryMethodSmooth=void 0;class Uo extends Fo{}Uo.prototype.ValueTypeName="color";class Go extends Fo{}function ko(t,e,n,i){No.call(this,t,e,n,i)}Go.prototype.ValueTypeName="number",ko.prototype=Object.assign(Object.create(No.prototype),{constructor:ko,interpolate_:function(t,e,n,i){const r=this.resultBuffer,s=this.sampleValues,a=this.valueSize,o=(n-e)/(i-e);let l=t*a;for(let t=l+a;l!==t;l+=4)yt.slerpFlat(r,0,s,l-a,s,l,o);return r}});class Vo extends Fo{InterpolantFactoryMethodLinear(t){return new ko(this.times,this.values,this.getValueSize(),t)}}Vo.prototype.ValueTypeName="quaternion",Vo.prototype.DefaultInterpolation=U,Vo.prototype.InterpolantFactoryMethodSmooth=void 0;class Wo extends Fo{}Wo.prototype.ValueTypeName="string",Wo.prototype.ValueBufferType=Array,Wo.prototype.DefaultInterpolation=H,Wo.prototype.InterpolantFactoryMethodLinear=void 0,Wo.prototype.InterpolantFactoryMethodSmooth=void 0;class jo extends Fo{}jo.prototype.ValueTypeName="vector";class qo{constructor(t,e=-1,n,i=2500){this.name=t,this.tracks=n,this.duration=e,this.blendMode=i,this.uuid=ot.generateUUID(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let t=0,r=n.length;t!==r;++t)e.push(Xo(n[t]).scale(i));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,i=n.length;t!==i;++t)e.push(Fo.toJSON(n[t]));return i}static CreateFromMorphTargetSequence(t,e,n,i){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=i[t];e||(i[t]=e=[]),e.push(n)}}const s=[];for(const t in i)s.push(this.CreateFromMorphTargetSequence(t,i[t],e,n));return s}static parseAnimation(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,i,r){if(0!==n.length){const s=[],a=[];Io.flattenJSON(n,s,a,i),0!==s.length&&r.push(new t(e,s,a))}},i=[],r=t.name||"default",s=t.fps||30,a=t.blendMode;let o=t.length||-1;const l=t.hierarchy||[];for(let t=0;t0||0===t.search(/^data\:image\/jpeg/);r.format=i?T:E,r.needsUpdate=!0,void 0!==e&&e(r)}),n,i),r}}),Object.assign(sl.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t=5){const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){const t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)n=this.getPoint(s/t),r+=n.distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){const n=this.getLengths();let i=0;const r=n.length;let s;s=e||t*n[r-1];let a,o=0,l=r-1;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),a=n[i]-s,a<0)o=i+1;else{if(!(a>0)){l=i;break}l=i-1}if(i=l,n[i]===s)return i/(r-1);const c=n[i];return(i+(s-c)/(n[i+1]-c))/(r-1)},getTangent:function(t,e){const n=1e-4;let i=t-n,r=t+n;i<0&&(i=0),r>1&&(r=1);const s=this.getPoint(i),a=this.getPoint(r),o=e||(s.isVector2?new lt:new xt);return o.copy(a).sub(s).normalize(),o},getTangentAt:function(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)},computeFrenetFrames:function(t,e){const n=new xt,i=[],r=[],s=[],a=new xt,o=new Jt;for(let e=0;e<=t;e++){const n=e/t;i[e]=this.getTangentAt(n,new xt),i[e].normalize()}r[0]=new xt,s[0]=new xt;let l=Number.MAX_VALUE;const c=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);c<=l&&(l=c,n.set(1,0,0)),h<=l&&(l=h,n.set(0,1,0)),u<=l&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],a),s[0].crossVectors(i[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),a.crossVectors(i[e-1],i[e]),a.length()>Number.EPSILON){a.normalize();const t=Math.acos(ot.clamp(i[e-1].dot(i[e]),-1,1));r[e].applyMatrix4(o.makeRotationAxis(a,t))}s[e].crossVectors(i[e],r[e])}if(!0===e){let e=Math.acos(ot.clamp(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(a.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(o.makeRotationAxis(i[n],e*n)),s[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}});class al extends sl{constructor(t=0,e=0,n=1,i=1,r=0,s=2*Math.PI,a=!1,o=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(t,e){const n=e||new lt,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)i;)r-=i;r0?0:(Math.floor(Math.abs(l)/r)+1)*r:0===c&&l===r-1&&(l=r-2,c=1),this.closed||l>0?a=i[(l-1)%r]:(cl.subVectors(i[0],i[1]).add(i[0]),a=cl);const h=i[l%r],u=i[(l+1)%r];if(this.closed||l+2i.length-2?i.length-1:s+1],h=i[s>i.length-3?i.length-1:s+2];return n.set(fl(a,o.x,l.x,c.x,h.x),fl(a,o.y,l.y,c.y,h.y)),n}copy(t){super.copy(t),this.points=[];for(let e=0,n=t.points.length;e=e){const t=n[i]-e,r=this.curves[i],s=r.getLength(),a=0===s?0:1-t/s;return r.getPointAt(a)}i++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,n=t.curves.length;e0){const t=l.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class Al extends El{constructor(t){super(t),this.uuid=ot.generateUUID(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let n=0,i=this.holes.length;n0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(i.uniforms[e]={},r.type){case"t":i.uniforms[e].value=n(r.value);break;case"c":i.uniforms[e].value=(new je).setHex(r.value);break;case"v2":i.uniforms[e].value=(new lt).fromArray(r.value);break;case"v3":i.uniforms[e].value=(new xt).fromArray(r.value);break;case"v4":i.uniforms[e].value=(new mt).fromArray(r.value);break;case"m3":i.uniforms[e].value=(new ct).fromArray(r.value);break;case"m4":i.uniforms[e].value=(new Jt).fromArray(r.value);break;default:i.uniforms[e].value=r.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const e in t.extensions)i.extensions[e]=t.extensions[e];if(void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new lt).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new lt).fromArray(t.clearcoatNormalScale)),void 0!==t.transmission&&(i.transmission=t.transmission),void 0!==t.transmissionMap&&(i.transmissionMap=n(t.transmissionMap)),i}setTextures(t){return this.textures=t,this}}const Zl={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let n=0,i=t.length;nNumber.EPSILON){if(l<0&&(n=e[s],o=-o,a=e[r],l=-l),t.ya.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=l*(t.x-n.x)-o*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(a.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=a.x)return!0}}return i}const r=no.isClockWise,s=this.subPaths;if(0===s.length)return[];if(!0===e)return n(s);let a,o,l;const c=[];if(1===s.length)return o=s[0],l=new Al,l.curves=o.curves,c.push(l),c;let h=!r(s[0].getPoints());h=t?!h:h;const u=[],d=[];let p,f,m=[],g=0;d[g]=void 0,m[g]=[];for(let e=0,n=s.length;e1){let t=!1;const e=[];for(let t=0,e=d.length;t0&&(t||(m=u))}for(let t=0,e=d.length;t0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(n[t]!==n[t+e]){a.setValue(n,i);break}}saveOriginalState(){const t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(let t=n,r=i;t!==r;++t)e[t]=e[i+t%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n=.5)for(let i=0;i!==r;++i)t[e+i]=t[n+i]}_slerp(t,e,n,i){yt.slerpFlat(t,e,t,e,t,n,i)}_slerpAdditive(t,e,n,i,r){const s=this._workIndex*r;yt.multiplyQuaternionsFlat(t,s,t,e,t,n),yt.slerpFlat(t,e,t,e,t,s,i)}_lerp(t,e,n,i,r){const s=1-i;for(let a=0;a!==r;++a){const r=e+a;t[r]=t[r]*s+t[n+a]*i}}_lerpAdditive(t,e,n,i,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[n+s]*i}}}const Ec="\\[\\]\\.:\\/",Ac=new RegExp("[\\[\\]\\.:\\/]","g"),Lc="[^\\[\\]\\.:\\/]",Rc="[^"+Ec.replace("\\.","")+"]",Cc=/((?:WC+[\/:])*)/.source.replace("WC",Lc),Pc=/(WCOD+)?/.source.replace("WCOD",Rc),Dc=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Lc),Ic=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Lc),Nc=new RegExp("^"+Cc+Pc+Dc+Ic+"$"),Bc=["material","materials","bones"];function Oc(t,e,n){const i=n||zc.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function zc(t,e,n){this.path=e,this.parsedPath=n||zc.parseTrackName(e),this.node=zc.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}Object.assign(Oc.prototype,{getValue:function(t,e){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(zc,{Composite:Oc,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new zc.Composite(t,e,n):new zc(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Ac,"")},parseTrackName:function(t){const e=Nc.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==Bc.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i=r){const s=r++,c=t[s];e[c.uuid]=l,t[l]=c,e[o]=s,t[s]=a;for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[s],r=e[l];e[l]=i,e[s]=r}}}this.nCachedObjects_=r}uncache(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,s=t.length;for(let a=0,o=arguments.length;a!==o;++a){const o=arguments[a].uuid,l=e[o];if(void 0!==l)if(delete e[o],l0&&(e[a.uuid]=l),t[l]=a,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t];e[l]=e[r],e.pop()}}}this.nCachedObjects_=r}subscribe_(t,e){const n=this._bindingsIndicesByPath;let i=n[t];const r=this._bindings;if(void 0!==i)return r[i];const s=this._paths,a=this._parsedPaths,o=this._objects,l=o.length,c=this.nCachedObjects_,h=new Array(l);i=r.length,n[t]=i,s.push(t),a.push(e),r.push(h);for(let n=c,i=o.length;n!==i;++n){const i=o[n];h[n]=new zc(i,t,e)}return h}unsubscribe_(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const i=this._paths,r=this._parsedPaths,s=this._bindings,a=s.length-1,o=s[a];e[t[a]]=n,s[n]=o,s.pop(),r[n]=r[a],r.pop(),i[n]=i[a],i.pop()}}}Fc.prototype.isAnimationObjectGroup=!0;class Hc{constructor(t,e,n=null,i=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=n,this.blendMode=i;const r=e.tracks,s=r.length,a=new Array(s),o={endingStart:k,endingEnd:k};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);a[t]=e,e.settings=o}this._interpolantSettings=o,this._interpolants=a,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const n=this._clip.duration,i=t._clip.duration,r=i/n,s=n/i;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,n){return t.crossFadeFrom(this,e,n)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,n){const i=this._mixer,r=i.time,s=this.timeScale;let a=this._timeScaleInterpolant;null===a&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const o=a.parameterPositions,l=a.sampleValues;return o[0]=r,o[1]=r+n,l[0]=t/s,l[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,n,i){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const i=(t-r)*n;if(i<0||0===n)return;this._startTime=null,e=n*i}e*=this._updateTimeScale(t);const s=this._updateTime(e),a=this._updateWeight(t);if(a>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case q:for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(s),e[n].accumulateAdditive(a);break;case j:default:for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(s),e[n].accumulate(i,a)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e}_updateTime(t){const e=this._clip.duration,n=this.loop;let i=this.time+t,r=this._loopCount;const s=2202===n;if(0===t)return-1===r?i:s&&1==(1&r)?e-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,s)):this._setEndings(0===this.repetitions,!0,s)),i>=e||i<0){const n=Math.floor(i/e);i-=e*n,r+=Math.abs(n);const a=this.repetitions-r;if(a<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===a){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(s&&1==(1&r))return e-i}return i}_setEndings(t,e,n){const i=this._interpolantSettings;n?(i.endingStart=V,i.endingEnd=V):(i.endingStart=t?this.zeroSlopeAtStart?V:k:W,i.endingEnd=e?this.zeroSlopeAtEnd?V:k:W)}_scheduleFading(t,e,n){const i=this._mixer,r=i.time;let s=this._weightInterpolant;null===s&&(s=i._lendControlInterpolant(),this._weightInterpolant=s);const a=s.parameterPositions,o=s.sampleValues;return a[0]=r,o[0]=e,a[1]=r+t,o[1]=n,this}}class Uc extends rt{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,e){const n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,s=t._propertyBindings,a=t._interpolants,o=n.uuid,l=this._bindingsByRootAndName;let c=l[o];void 0===c&&(c={},l[o]=c);for(let t=0;t!==r;++t){const r=i[t],l=r.name;let h=c[l];if(void 0!==h)s[t]=h;else{if(h=s[t],void 0!==h){null===h._cacheIndex&&(++h.referenceCount,this._addInactiveBinding(h,o,l));continue}const i=e&&e._propertyBindings[t].binding.parsedPath;h=new Tc(zc.create(n,l,i),r.ValueTypeName,r.getValueSize()),++h.referenceCount,this._addInactiveBinding(h,o,l),s[t]=h}a[t].resultBuffer=h.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){const e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this}update(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let a=0;a!==n;++a){e[a]._update(i,t,r,s)}const a=this._bindings,o=this._nActiveBindings;for(let t=0;t!==o;++t)a[t].apply(s);return this}setTime(t){this.time=0;for(let t=0;tthis.max.x||t.ythis.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new lt),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new lt),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Xc.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}Yc.prototype.isBox2=!0;const Zc=new xt,Jc=new xt;class Qc{constructor(t=new xt,e=new xt){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new xt),t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new xt),t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new xt),this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Zc.subVectors(t,this.start),Jc.subVectors(this.end,this.start);const n=Jc.dot(Jc);let i=Jc.dot(Zc)/n;return e&&(i=ot.clamp(i,0,1)),i}closestPointToPoint(t,e,n){const i=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new xt),this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}}function Kc(t){be.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Kc.prototype=Object.create(be.prototype),Kc.prototype.constructor=Kc,Kc.prototype.isImmediateRenderObject=!0;const $c=new xt;const th=new xt,eh=new Jt,nh=new Jt;class ih extends la{constructor(t){const e=rh(t),n=new vn,i=[],r=[],s=new je(0,0,1),a=new je(0,1,0);for(let t=0;t>16&32768,i=e>>12&2047;const r=e>>23&255;return r<103?n:r>142?(n|=31744,n|=(255==r?0:1)&&8388607&e,n):r<113?(i|=2048,n|=(i>>114-r)+(i>>113-r&1),n):(n|=r-112<<10|i>>1,n+=1&i,n)}},Sh=Math.pow(2,8),Th=[.125,.215,.35,.446,.526,.582],Eh=5+Th.length,Ah=20,Lh={[X]:0,[Y]:1,[J]:2,[Q]:3,[K]:4,[$]:5,[Z]:6},Rh=new qe({side:1,depthWrite:!1,depthTest:!1}),Ch=new Bn(new zn,Rh),Ph=new Gl,{_lodPlanes:Dh,_sizeLods:Ih,_sigmas:Nh}=kh(),Bh=new je;let Oh=null;const zh=(1+Math.sqrt(5))/2,Fh=1/zh,Hh=[new xt(1,1,1),new xt(-1,1,1),new xt(1,1,-1),new xt(-1,1,-1),new xt(0,zh,Fh),new xt(0,zh,-Fh),new xt(Fh,0,zh),new xt(-Fh,0,zh),new xt(zh,Fh,0),new xt(-zh,Fh,0)];function Uh(t){const e=Math.max(t.r,t.g,t.b),n=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);t.multiplyScalar(Math.pow(2,-n));return(n+128)/255}function Gh(t){return void 0!==t&&t.type===x&&(t.encoding===X||t.encoding===Y||t.encoding===Z)}function kh(){const t=[],e=[],n=[];let i=8;for(let r=0;r4?a=Th[r-8+4-1]:0==r&&(a=0),n.push(a);const o=1/(s-1),l=-o/2,c=1+o/2,h=[l,l,c,l,c,c,l,l,c,c,l,c],u=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*u),v=new Float32Array(f*d*u),y=new Float32Array(m*d*u);for(let t=0;t2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];g.set(i,p*d*t),v.set(h,f*d*t);const r=[t,t,t,t,t,t];y.set(r,m*d*t)}const x=new vn;x.setAttribute("position",new Ze(g,p)),x.setAttribute("uv",new Ze(v,f)),x.setAttribute("faceIndex",new Ze(y,m)),t.push(x),i>4&&i--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}function Vh(t){const e=new gt(3*Sh,3*Sh,t);return e.texture.mapping=l,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Wh(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function jh(){const t=new lt(1,1);return new Mo({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:t},inputEncoding:{value:Lh[3e3]},outputEncoding:{value:Lh[3e3]}},vertexShader:Xh(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t${Yh()}\n\n\t\t\t#include \n\n\t\t\tvoid main(){\n\n\t\t\t\tgl_FragColor=vec4(0.0, 0.0, 0.0, 1.0);\n\n\t\t\t\tvec3 outputDirection=normalize(vOutputDirection);\n\t\t\t\tvec2 uv=equirectUv(outputDirection);\n\n\t\t\t\tvec2 f=fract(uv / texelSize - 0.5);\n\t\t\t\tuv -=f * texelSize;\n\t\t\t\tvec3 tl=envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\t\t\t\tuv.x +=texelSize.x;\n\t\t\t\tvec3 tr=envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\t\t\t\tuv.y +=texelSize.y;\n\t\t\t\tvec3 br=envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\t\t\t\tuv.x -=texelSize.x;\n\t\t\t\tvec3 bl=envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n\n\t\t\t\tvec3 tm=mix(tl, tr, f.x);\n\t\t\t\tvec3 bm=mix(bl, br, f.x);\n\t\t\t\tgl_FragColor.rgb=mix(tm, bm, f.y);\n\n\t\t\t\tgl_FragColor=linearToOutputTexel(gl_FragColor);\n\n\t\t\t}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})}function qh(){return new Mo({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:Lh[3e3]},outputEncoding:{value:Lh[3e3]}},vertexShader:Xh(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t${Yh()}\n\n\t\t\tvoid main(){\n\n\t\t\t\tgl_FragColor=vec4(0.0, 0.0, 0.0, 1.0);\n\t\t\t\tgl_FragColor.rgb=envMapTexelToLinear(textureCube(envMap, vec3(- vOutputDirection.x, vOutputDirection.yz))).rgb;\n\t\t\t\tgl_FragColor=linearToOutputTexel(gl_FragColor);\n\n\t\t\t}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})}function Xh(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection(vec2 uv, float face){\n\n\t\t\tuv=2.0 * uv - 1.0;\n\n\t\t\tvec3 direction=vec3(uv, 1.0);\n\n\t\t\tif(face==0.0){\n\n\t\t\t\tdirection=direction.zyx; //(1, v, u) pos x\n\n\t\t\t}else if(face==1.0){\n\n\t\t\t\tdirection=direction.xzy;\n\t\t\t\tdirection.xz *=-1.0; //(-u, 1, -v) pos y\n\n\t\t\t}else if(face==2.0){\n\n\t\t\t\tdirection.x *=-1.0; //(-u, v, 1) pos z\n\n\t\t\t}else if(face==3.0){\n\n\t\t\t\tdirection=direction.zyx;\n\t\t\t\tdirection.xz *=-1.0; //(-1, v, -u) neg x\n\n\t\t\t}else if(face==4.0){\n\n\t\t\t\tdirection=direction.xzy;\n\t\t\t\tdirection.xy *=-1.0; //(-u, -1, v) neg y\n\n\t\t\t}else if(face==5.0){\n\n\t\t\t\tdirection.z *=-1.0; //(u, v, -1) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main(){\n\n\t\t\tvOutputDirection=getDirection(uv, faceIndex);\n\t\t\tgl_Position=vec4(position, 1.0);\n\n\t\t}\n\t"}function Yh(){return"\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear(vec4 value){\n\n\t\t\tif(inputEncoding==0){\n\n\t\t\t\treturn value;\n\n\t\t\t}else if(inputEncoding==1){\n\n\t\t\t\treturn sRGBToLinear(value);\n\n\t\t\t}else if(inputEncoding==2){\n\n\t\t\t\treturn RGBEToLinear(value);\n\n\t\t\t}else if(inputEncoding==3){\n\n\t\t\t\treturn RGBMToLinear(value, 7.0);\n\n\t\t\t}else if(inputEncoding==4){\n\n\t\t\t\treturn RGBMToLinear(value, 16.0);\n\n\t\t\t}else if(inputEncoding==5){\n\n\t\t\t\treturn RGBDToLinear(value, 256.0);\n\n\t\t\t}else{\n\n\t\t\t\treturn GammaToLinear(value, 2.2);\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel(vec4 value){\n\n\t\t\tif(outputEncoding==0){\n\n\t\t\t\treturn value;\n\n\t\t\t}else if(outputEncoding==1){\n\n\t\t\t\treturn LinearTosRGB(value);\n\n\t\t\t}else if(outputEncoding==2){\n\n\t\t\t\treturn LinearToRGBE(value);\n\n\t\t\t}else if(outputEncoding==3){\n\n\t\t\t\treturn LinearToRGBM(value, 7.0);\n\n\t\t\t}else if(outputEncoding==4){\n\n\t\t\t\treturn LinearToRGBM(value, 16.0);\n\n\t\t\t}else if(outputEncoding==5){\n\n\t\t\t\treturn LinearToRGBD(value, 256.0);\n\n\t\t\t}else{\n\n\t\t\t\treturn LinearToGamma(value, 2.2);\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear(vec4 color){\n\n\t\t\treturn inputTexelToLinear(color);\n\n\t\t}\n\t"}sl.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(sl.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},El.prototype.fromPoints=function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)},lh.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},ih.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Qo.prototype.extractUrlBase=function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),Zl.extractUrlBase(t)},Qo.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Yc.prototype.center=function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},Yc.prototype.empty=function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Yc.prototype.isIntersectionBox=function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},Yc.prototype.size=function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)},wt.prototype.center=function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},wt.prototype.empty=function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},wt.prototype.isIntersectionBox=function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},wt.prototype.isIntersectionSphere=function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},wt.prototype.size=function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)},Gt.prototype.empty=function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()},Qn.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},Qc.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},ot.random16=function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},ot.nearestPowerOfTwo=function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),ot.floorPowerOfTwo(t)},ot.nextPowerOfTwo=function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),ot.ceilPowerOfTwo(t)},ct.prototype.flattenToArrayOffset=function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},ct.prototype.multiplyVector3=function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3(matrix) instead."),t.applyMatrix3(this)},ct.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},ct.prototype.applyToBufferAttribute=function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3(matrix) instead."),t.applyMatrix3(this)},ct.prototype.applyToVector3Array=function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},ct.prototype.getInverse=function(t){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy(matrix).invert(); instead."),this.copy(t).invert()},Jt.prototype.extractPosition=function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},Jt.prototype.flattenToArrayOffset=function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},Jt.prototype.getPosition=function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition(matrix) instead."),(new xt).setFromMatrixColumn(this,3)},Jt.prototype.setRotationFromQuaternion=function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},Jt.prototype.multiplyToArray=function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},Jt.prototype.multiplyVector3=function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4(matrix) instead."),t.applyMatrix4(this)},Jt.prototype.multiplyVector4=function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4(matrix) instead."),t.applyMatrix4(this)},Jt.prototype.multiplyVector3Array=function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},Jt.prototype.rotateAxis=function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection(matrix) instead."),t.transformDirection(this)},Jt.prototype.crossVector=function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4(matrix) instead."),t.applyMatrix4(this)},Jt.prototype.translate=function(){console.error("THREE.Matrix4: .translate() has been removed.")},Jt.prototype.rotateX=function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},Jt.prototype.rotateY=function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},Jt.prototype.rotateZ=function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},Jt.prototype.rotateByAxis=function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},Jt.prototype.applyToBufferAttribute=function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4(matrix) instead."),t.applyMatrix4(this)},Jt.prototype.applyToVector3Array=function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},Jt.prototype.makeFrustum=function(t,e,n,i,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective(left, right, top, bottom, near, far) instead."),this.makePerspective(t,e,i,n,r,s)},Jt.prototype.getInverse=function(t){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy(matrix).invert(); instead."),this.copy(t).invert()},Te.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},yt.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion(quaternion) instead."),t.applyQuaternion(this)},yt.prototype.inverse=function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()},Zt.prototype.isIntersectionBox=function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},Zt.prototype.isIntersectionPlane=function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},Zt.prototype.isIntersectionSphere=function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},Oe.prototype.area=function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},Oe.prototype.barycoordFromPoint=function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},Oe.prototype.midpoint=function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},Oe.prototypenormal=function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},Oe.prototype.plane=function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)},Oe.barycoordFromPoint=function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Oe.getBarycoord(t,e,n,i,r)},Oe.normal=function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Oe.getNormal(t,e,n,i)},Al.prototype.extractAllPoints=function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},Al.prototype.extrude=function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new so(this,t)},Al.prototype.makeGeometry=function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new po(this,t)},lt.prototype.fromAttribute=function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lt.prototype.distanceToManhattan=function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},xt.prototype.setEulerFromRotationMatrix=function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},xt.prototype.setEulerFromQuaternion=function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},xt.prototype.getPositionFromMatrix=function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},xt.prototype.getScaleFromMatrix=function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},xt.prototype.getColumnFromMatrix=function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},xt.prototype.applyProjection=function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4(m) instead."),this.applyMatrix4(t)},xt.prototype.fromAttribute=function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},xt.prototype.distanceToManhattan=function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},xt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},mt.prototype.fromAttribute=function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},mt.prototype.lengthManhattan=function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()},be.prototype.getChildByName=function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},be.prototype.renderDepth=function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},be.prototype.translate=function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis(axis, distance) instead."),this.translateOnAxis(e,t)},be.prototype.getWorldRotation=function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion(target) instead.")},be.prototype.applyMatrix=function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},Object.defineProperties(be.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Bn.prototype.setDrawMode=function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")},Object.defineProperties(Bn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Vs.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(sl.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Vn.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Ll.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper(light.shadow.camera) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Ze.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===nt},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(nt)}}}),Ze.prototype.setDynamic=function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?nt:et),this},Ze.prototype.copyIndicesArray=function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},Ze.prototype.setArray=function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},vn.prototype.addIndex=function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},vn.prototype.addAttribute=function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects(name, attribute)."),this.setAttribute(t,new Ze(arguments[1],arguments[2])))},vn.prototype.addDrawCall=function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},vn.prototype.clearDrawCalls=function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},vn.prototype.computeOffsets=function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},vn.prototype.removeAttribute=function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},vn.prototype.applyMatrix=function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},Object.defineProperties(vn.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Jl.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(Wc.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(gs.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===nt},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),gs.prototype.setDynamic=function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?nt:et),this},gs.prototype.setArray=function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")},so.prototype.getArrays=function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},so.prototype.addShapeList=function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},so.prototype.addShape=function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")},ms.prototype.dispose=function(){console.error("THREE.Scene: .dispose() has been removed.")},Gc.prototype.onUpdate=function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this},Object.defineProperties(Fe.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new je}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(To.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(t){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=t}}}),Object.defineProperties(Gn.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),us.prototype.clearTarget=function(t,e,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,i)},us.prototype.animate=function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},us.prototype.getCurrentRenderTarget=function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},us.prototype.getMaxAnisotropy=function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},us.prototype.getPrecision=function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},us.prototype.resetGLState=function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},us.prototype.supportsFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get('OES_texture_float')."),this.extensions.get("OES_texture_float")},us.prototype.supportsHalfFloatTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get('OES_texture_half_float')."),this.extensions.get("OES_texture_half_float")},us.prototype.supportsStandardDerivatives=function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get('OES_standard_derivatives')."),this.extensions.get("OES_standard_derivatives")},us.prototype.supportsCompressedTextureS3TC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get('WEBGL_compressed_texture_s3tc')."),this.extensions.get("WEBGL_compressed_texture_s3tc")},us.prototype.supportsCompressedTexturePVRTC=function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get('WEBGL_compressed_texture_pvrtc')."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},us.prototype.supportsBlendMinMax=function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get('EXT_blend_minmax')."),this.extensions.get("EXT_blend_minmax")},us.prototype.supportsVertexTextures=function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},us.prototype.supportsInstancedArrays=function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get('ANGLE_instanced_arrays')."),this.extensions.get("ANGLE_instanced_arrays")},us.prototype.enableScissorTest=function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},us.prototype.initMaterial=function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},us.prototype.addPrePlugin=function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},us.prototype.addPostPlugin=function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},us.prototype.updateShadowMap=function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},us.prototype.setFaceCulling=function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},us.prototype.allocTextureUnit=function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},us.prototype.setTexture=function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},us.prototype.setTexture2D=function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},us.prototype.setTextureCube=function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},us.prototype.getActiveMipMapLevel=function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()},Object.defineProperties(us.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?Y:X}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(ns.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(gt.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),xc.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return(new lc).load(t,(function(t){e.setBuffer(t)})),this},Sc.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},jn.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)},jn.prototype.clear=function(t,e,n,i){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(t,e,n,i)},ut.crossOrigin=void 0,ut.loadTexture=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new rl;r.setCrossOrigin(this.crossOrigin);const s=r.load(t,n,void 0,i);return e&&(s.mapping=e),s},ut.loadTextureCube=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new nl;r.setCrossOrigin(this.crossOrigin);const s=r.load(t,n,void 0,i);return e&&(s.mapping=e),s},ut.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},ut.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const Zh={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:e}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=e),t.ACESFilmicToneMapping=4,t.AddEquation=n,t.AddOperation=2,t.AdditiveAnimationBlendMode=q,t.AdditiveBlending=2,t.AlphaFormat=1021,t.AlwaysDepth=1,t.AlwaysStencilFunc=519,t.AmbientLight=Wl,t.AmbientLightProbe=hc,t.AnimationClip=qo,t.AnimationLoader=class extends Qo{constructor(t){super(t)}load(t,e,n,i){const r=this,s=new $o(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(n){try{e(r.parse(JSON.parse(n)))}catch(e){i?i(e):console.error(e),r.manager.itemError(t)}}),n,i)}parse(t){const e=[];for(let n=0;n.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{vh.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(vh,e)}}setLength(t,e=.2*t,n=.2*e){this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}},t.Audio=xc,t.AudioAnalyser=Sc,t.AudioContext=oc,t.AudioListener=class extends be{constructor(){super(),this.type="AudioListener",this.context=oc.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new pc}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(mc,gc,vc),yc.set(0,0,-1).applyQuaternion(gc),e.positionX){const t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(mc.x,t),e.positionY.linearRampToValueAtTime(mc.y,t),e.positionZ.linearRampToValueAtTime(mc.z,t),e.forwardX.linearRampToValueAtTime(yc.x,t),e.forwardY.linearRampToValueAtTime(yc.y,t),e.forwardZ.linearRampToValueAtTime(yc.z,t),e.upX.linearRampToValueAtTime(n.x,t),e.upY.linearRampToValueAtTime(n.y,t),e.upZ.linearRampToValueAtTime(n.z,t)}else e.setPosition(mc.x,mc.y,mc.z),e.setOrientation(yc.x,yc.y,yc.z,n.x,n.y,n.z)}},t.AudioLoader=lc,t.AxesHelper=_h,t.AxisHelper=function(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new _h(t)},t.BackSide=1,t.BasicDepthPacking=3200,t.BasicShadowMap=0,t.BinaryTextureLoader=function(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new il(t)},t.Bone=Ws,t.BooleanKeyframeTrack=Ho,t.BoundingBoxHelper=function(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new gh(t,e)},t.Box2=Yc,t.Box3=wt,t.Box3Helper=class extends la{constructor(t,e=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new vn;i.setIndex(new Ze(n,1)),i.setAttribute("position",new sn([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(i,new $s({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}},t.BoxBufferGeometry=zn,t.BoxGeometry=zn,t.BoxHelper=gh,t.BufferAttribute=Ze,t.BufferGeometry=vn,t.BufferGeometryLoader=Kl,t.ByteType=1010,t.Cache=Yo,t.Camera=kn,t.CameraHelper=class extends la{constructor(t){const e=new vn,n=new $s({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],r=[],s={},a=new je(16755200),o=new je(16711680),l=new je(43775),c=new je(16777215),h=new je(3355443);function u(t,e,n){d(t,n),d(e,n)}function d(t,e){i.push(0,0,0),r.push(e.r,e.g,e.b),void 0===s[t]&&(s[t]=[]),s[t].push(i.length/3-1)}u("n1","n2",a),u("n2","n4",a),u("n4","n3",a),u("n3","n1",a),u("f1","f2",a),u("f2","f4",a),u("f4","f3",a),u("f3","f1",a),u("n1","f1",a),u("n2","f2",a),u("n3","f3",a),u("n4","f4",a),u("p","n1",o),u("p","n2",o),u("p","n3",o),u("p","n4",o),u("u1","u2",l),u("u2","u3",l),u("u3","u1",l),u("c","t",c),u("p","c",h),u("cn1","cn2",h),u("cn3","cn4",h),u("cf1","cf2",h),u("cf3","cf4",h),e.setAttribute("position",new sn(i,3)),e.setAttribute("color",new sn(r,3)),super(e,n),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}update(){const t=this.geometry,e=this.pointMap;ph.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),fh("c",e,t,ph,0,0,-1),fh("t",e,t,ph,0,0,1),fh("n1",e,t,ph,-1,-1,-1),fh("n2",e,t,ph,1,-1,-1),fh("n3",e,t,ph,-1,1,-1),fh("n4",e,t,ph,1,1,-1),fh("f1",e,t,ph,-1,-1,1),fh("f2",e,t,ph,1,-1,1),fh("f3",e,t,ph,-1,1,1),fh("f4",e,t,ph,1,1,1),fh("u1",e,t,ph,.7,1.1,-1),fh("u2",e,t,ph,-.7,1.1,-1),fh("u3",e,t,ph,0,2,-1),fh("cf1",e,t,ph,-1,0,1),fh("cf2",e,t,ph,1,0,1),fh("cf3",e,t,ph,0,-1,1),fh("cf4",e,t,ph,0,1,1),fh("cn1",e,t,ph,-1,0,-1),fh("cn2",e,t,ph,1,0,-1),fh("cn3",e,t,ph,0,-1,-1),fh("cn4",e,t,ph,0,1,-1),t.getAttribute("position").needsUpdate=!0}},t.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been removed")},t.CanvasTexture=xa,t.CatmullRomCurve3=pl,t.CineonToneMapping=3,t.CircleBufferGeometry=ba,t.CircleGeometry=ba,t.ClampToEdgeWrapping=u,t.Clock=pc,t.Color=je,t.ColorKeyframeTrack=Uo,t.CompressedTexture=ya,t.CompressedTextureLoader=tl,t.ConeBufferGeometry=Ma,t.ConeGeometry=Ma,t.CubeCamera=jn,t.CubeReflectionMapping=r,t.CubeRefractionMapping=s,t.CubeTexture=qn,t.CubeTextureLoader=nl,t.CubeUVReflectionMapping=l,t.CubeUVRefractionMapping=c,t.CubicBezierCurve=vl,t.CubicBezierCurve3=yl,t.CubicInterpolant=Bo,t.CullFaceBack=1,t.CullFaceFront=2,t.CullFaceFrontBack=3,t.CullFaceNone=0,t.Curve=sl,t.CurvePath=Tl,t.CustomBlending=5,t.CustomToneMapping=5,t.CylinderBufferGeometry=wa,t.CylinderGeometry=wa,t.Cylindrical=class{constructor(t=1,e=0,n=0){return this.radius=t,this.theta=e,this.y=n,this}set(t,e,n){return this.radius=t,this.theta=e,this.y=n,this}copy(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}clone(){return(new this.constructor).copy(this)}},t.DataTexture=Yn,t.DataTexture2DArray=yi,t.DataTexture3D=xi,t.DataTextureLoader=il,t.DataUtils=Mh,t.DecrementStencilOp=7683,t.DecrementWrapStencilOp=34056,t.DefaultLoadingManager=Jo,t.DepthFormat=A,t.DepthStencilFormat=L,t.DepthTexture=_a,t.DirectionalLight=Vl,t.DirectionalLightHelper=class extends be{constructor(t,e,n){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);let i=new vn;i.setAttribute("position",new sn([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const r=new $s({fog:!1,toneMapped:!1});this.lightPlane=new sa(i,r),this.add(this.lightPlane),i=new vn,i.setAttribute("position",new sn([0,0,0,0,0,1],3)),this.targetLine=new sa(i,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){ch.setFromMatrixPosition(this.light.matrixWorld),hh.setFromMatrixPosition(this.light.target.matrixWorld),uh.subVectors(hh,ch),this.lightPlane.lookAt(hh),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(hh),this.targetLine.scale.z=uh.length()}},t.DiscreteInterpolant=zo,t.DodecahedronBufferGeometry=Ta,t.DodecahedronGeometry=Ta,t.DoubleSide=2,t.DstAlphaFactor=206,t.DstColorFactor=208,t.DynamicBufferAttribute=function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage(THREE.DynamicDrawUsage) instead."),new Ze(t,e).setUsage(nt)},t.DynamicCopyUsage=35050,t.DynamicDrawUsage=nt,t.DynamicReadUsage=35049,t.EdgesGeometry=Ca,t.EdgesHelper=function(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new la(new Ca(t.geometry),new $s({color:void 0!==e?e:16777215}))},t.EllipseCurve=al,t.EqualDepth=4,t.EqualStencilFunc=514,t.EquirectangularReflectionMapping=a,t.EquirectangularRefractionMapping=o,t.Euler=ae,t.EventDispatcher=rt,t.ExtrudeBufferGeometry=so,t.ExtrudeGeometry=so,t.FaceColors=1,t.FileLoader=$o,t.FlatShading=1,t.Float16BufferAttribute=rn,t.Float32Attribute=function(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new sn(t,e)},t.Float32BufferAttribute=sn,t.Float64Attribute=function(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new an(t,e)},t.Float64BufferAttribute=an,t.FloatType=w,t.Fog=fs,t.FogExp2=ps,t.Font=rc,t.FontLoader=class extends Qo{constructor(t){super(t)}load(t,e,n,i){const r=this,s=new $o(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(t){let n;try{n=JSON.parse(t)}catch(e){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}const i=r.parse(n);e&&e(i)}),n,i)}parse(t){return new rc(t)}},t.FrontSide=0,t.Frustum=Qn,t.GLBufferAttribute=Vc,t.GLSL1="100",t.GLSL3=it,t.GammaEncoding=Z,t.GreaterDepth=6,t.GreaterEqualDepth=5,t.GreaterEqualStencilFunc=518,t.GreaterStencilFunc=516,t.GridHelper=lh,t.Group=os,t.HalfFloatType=M,t.HemisphereLight=Rl,t.HemisphereLightHelper=class extends be{constructor(t,e,n){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const i=new co(e);i.rotateY(.5*Math.PI),this.material=new qe({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=i.getAttribute("position"),s=new Float32Array(3*r.count);i.setAttribute("color",new Ze(s,3)),this.add(new Bn(i,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const e=t.geometry.getAttribute("color");ah.copy(this.light.color),oh.copy(this.light.groundColor);for(let t=0,n=e.count;t0){const n=new Zo(e);r=new el(n),r.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e\n\n\t\t\tvec3 getSample(float theta, vec3 axis){\n\n\t\t\t\tfloat cosTheta=cos(theta);\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection=vOutputDirection * cosTheta\n\t\t\t\t\t+ cross(axis, vOutputDirection) * sin(theta)\n\t\t\t\t\t+ axis * dot(axis, vOutputDirection) *(1.0 - cosTheta);\n\n\t\t\t\treturn bilinearCubeUV(envMap, sampleDirection, mipInt);\n\n\t\t\t}\n\n\t\t\tvoid main(){\n\n\t\t\t\tvec3 axis=latitudinal ? poleAxis:cross(poleAxis, vOutputDirection);\n\n\t\t\t\tif(all(equal(axis, vec3(0.0)))){\n\n\t\t\t\t\taxis=vec3(vOutputDirection.z, 0.0, - vOutputDirection.x);\n\n\t\t\t\t}\n\n\t\t\t\taxis=normalize(axis);\n\n\t\t\t\tgl_FragColor=vec4(0.0, 0.0, 0.0, 1.0);\n\t\t\t\tgl_FragColor.rgb +=weights[ 0 ] * getSample(0.0, axis);\n\n\t\t\t\tfor(int i=1; i < n; i++){\n\n\t\t\t\t\tif(i >=samples){\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta=dTheta * float(i);\n\t\t\t\t\tgl_FragColor.rgb +=weights[ i ] * getSample(-1.0 * theta, axis);\n\t\t\t\t\tgl_FragColor.rgb +=weights[ i ] * getSample(theta, axis);\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor=linearToOutputTexel(gl_FragColor);\n\n\t\t\t}\n\t\t`,blending:0,depthTest:!1,depthWrite:!1})}(Ah),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,n=.1,i=100){Oh=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t){return this._fromTexture(t)}fromCubemap(t){return this._fromTexture(t)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=qh(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=jh(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let t=0;t2?Sh:0,Sh,Sh),o.setRenderTarget(i),u&&o.render(Ch,r),o.render(t,r)}o.toneMapping=h,o.outputEncoding=c,o.autoClear=l}_textureToCubeUV(t,e){const n=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=qh()):null==this._equirectShader&&(this._equirectShader=jh());const i=t.isCubeTexture?this._cubemapShader:this._equirectShader,r=new Bn(Dh[0],i),s=i.uniforms;s.envMap.value=t,t.isCubeTexture||s.texelSize.value.set(1/t.image.width,1/t.image.height),s.inputEncoding.value=Lh[t.encoding],s.outputEncoding.value=Lh[e.texture.encoding],Wh(e,0,0,3*Sh,2*Sh),n.setRenderTarget(e),n.render(r,Ph)}_applyPMREM(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let e=1;eAh&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t4?i-8+4:0),3*v,2*v),o.setRenderTarget(e),o.render(c,Ph)}},t.ParametricBufferGeometry=ho,t.ParametricGeometry=ho,t.Particle=function(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Is(t)},t.ParticleBasicMaterial=function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new ha(t)},t.ParticleSystem=function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new ma(t,e)},t.ParticleSystemMaterial=function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new ha(t)},t.Path=El,t.PerspectiveCamera=Vn,t.Plane=Te,t.PlaneBufferGeometry=ti,t.PlaneGeometry=ti,t.PlaneHelper=class extends sa{constructor(t,e=1,n=16776960){const i=n,r=new vn;r.setAttribute("position",new sn([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),super(r,new $s({color:i,toneMapped:!1})),this.type="PlaneHelper",this.plane=t,this.size=e;const s=new vn;s.setAttribute("position",new sn([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),this.add(new Bn(s,new qe({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(t){let e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?1:0,this.lookAt(this.plane.normal),super.updateMatrixWorld(t)}},t.PointCloud=function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new ma(t,e)},t.PointCloudMaterial=function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new ha(t)},t.PointLight=Ul,t.PointLightHelper=class extends Bn{constructor(t,e,n){super(new fo(e,4,2),new qe({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.light.updateMatrixWorld(),this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},t.Points=ma,t.PointsMaterial=ha,t.PolarGridHelper=class extends la{constructor(t=10,e=16,n=8,i=64,r=4473924,s=8947848){r=new je(r),s=new je(s);const a=[],o=[];for(let n=0;n<=e;n++){const i=n/e*(2*Math.PI),l=Math.sin(i)*t,c=Math.cos(i)*t;a.push(0,0,0),a.push(l,0,c);const h=1&n?r:s;o.push(h.r,h.g,h.b),o.push(h.r,h.g,h.b)}for(let e=0;e<=n;e++){const l=1&e?r:s,c=t-t/n*e;for(let t=0;t\nvarying vec2 vUv;\nuniform sampler2D tColor;\nuniform sampler2D tDepth;\nuniform float maxblur;\nuniform float aperture;\nuniform float nearClip;\nuniform float farClip;\nuniform float focus;\nuniform float aspect;\n#include \nfloat getDepth(const in vec2 screenPosition){\n\t#if DEPTH_PACKING==1\n\treturn unpackRGBAToDepth(TEXTURE2D(tDepth, screenPosition));\n\t#else\n\treturn TEXTURE2D(tDepth, screenPosition).x;\n\t#endif\n}\nfloat getViewZ(const in float depth){\n\t#if PERSPECTIVE_CAMERA==1\n\treturn perspectiveDepthToViewZ(depth, nearClip, farClip);\n\t#else\n\treturn orthographicDepthToViewZ(depth, nearClip, farClip);\n\t#endif\n}\nvoid main(){\n\tvec2 aspectcorrect=vec2(1.0, aspect);\n\tfloat viewZ=getViewZ(getDepth(vUv));\n\tfloat factor=(focus + viewZ);\n\tvec2 dofblur=vec2(clamp(factor * aperture, -maxblur, maxblur));\n\tvec2 dofblur9=dofblur * 0.9;\n\tvec2 dofblur7=dofblur * 0.7;\n\tvec2 dofblur4=dofblur * 0.4;\n\tvec4 col=vec4(0.0);\n\tcol +=TEXTURE2D(tColor, vUv.xy);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.0, 0.4) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.15, 0.37) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.29, 0.29) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.37, 0.15) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.40, 0.0) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.37, -0.15) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.29, -0.29) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.15, -0.37) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.0, -0.4) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.15, 0.37) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.29, 0.29) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.37, 0.15) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.4, 0.0) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.37, -0.15) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.29, -0.29) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.15, -0.37) * aspectcorrect) * dofblur);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.15, 0.37) * aspectcorrect) * dofblur9);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.37, 0.15) * aspectcorrect) * dofblur9);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.37, -0.15) * aspectcorrect) * dofblur9);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.15, -0.37) * aspectcorrect) * dofblur9);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.15, 0.37) * aspectcorrect) * dofblur9);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.37, 0.15) * aspectcorrect) * dofblur9);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.37, -0.15) * aspectcorrect) * dofblur9);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.15, -0.37) * aspectcorrect) * dofblur9);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.29, 0.29) * aspectcorrect) * dofblur7);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.40, 0.0) * aspectcorrect) * dofblur7);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.29, -0.29) * aspectcorrect) * dofblur7);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.0, -0.4) * aspectcorrect) * dofblur7);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.29, 0.29) * aspectcorrect) * dofblur7);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.4, 0.0) * aspectcorrect) * dofblur7);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.29, -0.29) * aspectcorrect) * dofblur7);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.0, 0.4) * aspectcorrect) * dofblur7);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.29, 0.29) * aspectcorrect) * dofblur4);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.4, 0.0) * aspectcorrect) * dofblur4);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.29, -0.29) * aspectcorrect) * dofblur4);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.0, -0.4) * aspectcorrect) * dofblur4);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.29, 0.29) * aspectcorrect) * dofblur4);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.4, 0.0) * aspectcorrect) * dofblur4);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(-0.29, -0.29) * aspectcorrect) * dofblur4);\n\tcol +=TEXTURE2D(tColor, vUv.xy +(vec2(0.0, 0.4) * aspectcorrect) * dofblur4);\n\tgl_FragColor=col / 41.0;\n\t#transparent\n}"}; THREE.BokehPass=function (a, b, c){ THREE.Pass.call(this), this.scene=a, this.camera=b; var d=c.focus===void 0 ? 1:c.focus, e=c.aspect===void 0 ? b.aspect:c.aspect, f=c.aperture===void 0 ? .025:c.aperture, g=c.maxblur===void 0 ? 1:c.maxblur, h=c.width||window.innerWidth||1, i=c.height||window.innerHeight||1; this.renderTargetDepth=new THREE.WebGLRenderTarget(h, i, { minFilter: THREE.NearestFilter, magFilter: THREE.NearestFilter }), this.renderTargetDepth.texture.name="BokehPass.depth", this.materialDepth=new THREE.MeshDepthMaterial, this.materialDepth.depthPacking=THREE.RGBADepthPacking, this.materialDepth.blending=THREE.NoBlending, THREE.BokehShader===void 0&&console.error("THREE.BokehPass relies on THREE.BokehShader"); var j=THREE.BokehShader, k=THREE.UniformsUtils.clone(j.uniforms); k.tDepth.value=this.renderTargetDepth.texture, k.focus.value=d, k.aspect.value=e, k.aperture.value=f, k.maxblur.value=g, k.nearClip.value=b.near, k.farClip.value=b.far; if(c.transparent) j.fragmentShader=j.fragmentShader.replace('#transparent', ''); else j.fragmentShader=j.fragmentShader.replace('#transparent', 'gl_FragColor.a=1.0;'); this.materialBokeh=new THREE.ShaderMaterial({ defines: Object.assign({}, j.defines), uniforms: k, vertexShader: j.vertexShader, fragmentShader: j.fragmentShader }), this.uniforms=k, this.needsSwap = !1, this.fsQuad=new THREE.Pass.FullScreenQuad(this.materialBokeh), this._oldClearColor=new THREE.Color }, THREE.BokehPass.prototype=Object.assign(Object.create(THREE.Pass.prototype), { constructor: THREE.BokehPass, render: function (a, b, c){ this.scene.overrideMaterial=this.materialDepth, a.getClearColor(this._oldClearColor); var d=a.getClearAlpha(), e=a.autoClear; a.autoClear = !1, a.setClearColor(16777215), a.setClearAlpha(1), a.setRenderTarget(this.renderTargetDepth), a.clear(), a.render(this.scene, this.camera), this.uniforms.tColor.value=c.texture, this.uniforms.nearClip.value=this.camera.near, this.uniforms.farClip.value=this.camera.far, this.renderToScreen ? (a.setRenderTarget(null), this.fsQuad.render(a)):(a.setRenderTarget(b), a.clear(), this.fsQuad.render(a)), this.scene.overrideMaterial=null, a.setClearColor(this._oldClearColor), a.setClearAlpha(d), a.autoClear=e }}); THREE.FilmShader={uniforms:{tDiffuse:{value:null},time:{value:0},nIntensity:{value:.5},sIntensity:{value:.05},sCount:{value:4096},grayscale:{value:1}},vertexShader:["varying vec2 vUv;","void main(){","\tvUv=uv;","\tgl_Position=projectionMatrix * modelViewMatrix * vec4(position, 1.0);","}"].join("\n"),fragmentShader:["#if __VERSION__ < 130\n#define TEXTURE2D texture2D\n#else\n#define TEXTURE2D texture\n#endif\n#include ","uniform float time;","uniform bool grayscale;","uniform float nIntensity;","uniform float sIntensity;","uniform float sCount;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main(){","\tvec4 cTextureScreen=TEXTURE2D(tDiffuse, vUv);","\tfloat dx=rand (vUv + time);","\tvec3 cResult=cTextureScreen.rgb + cTextureScreen.rgb * clamp(0.1 + dx, 0.0, 1.0);","\tvec2 sc=vec2(sin(vUv.y * sCount), cos(vUv.y * sCount));","\tcResult +=cTextureScreen.rgb * vec3(sc.x, sc.y, sc.x) * sIntensity;","\tcResult=cTextureScreen.rgb + clamp(nIntensity, 0.0,1.0) *(cResult - cTextureScreen.rgb);","\tif(grayscale){","\t\tcResult=vec3(cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11);","\t}","\tgl_FragColor=vec4(cResult, cTextureScreen.a);","}"].join("\n")},THREE.FilmPass=function(e,t,r,s){THREE.Pass.call(this),void 0===THREE.FilmShader&&console.error("THREE.FilmPass relies on THREE.FilmShader");var i=THREE.FilmShader;this.uniforms=THREE.UniformsUtils.clone(i.uniforms),this.material=new THREE.ShaderMaterial({uniforms:this.uniforms,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader}),void 0!==s&&(this.uniforms.grayscale.value=s),void 0!==e&&(this.uniforms.nIntensity.value=e),void 0!==t&&(this.uniforms.sIntensity.value=t),void 0!==r&&(this.uniforms.sCount.value=r),this.fsQuad=new THREE.Pass.FullScreenQuad(this.material)},THREE.FilmPass.prototype=Object.assign(Object.create(THREE.Pass.prototype),{constructor:THREE.FilmPass,render:function(e,t,r,s){this.uniforms.tDiffuse.value=r.texture,this.uniforms.time.value+=s,this.renderToScreen?e.setRenderTarget(null):(e.setRenderTarget(t),this.clear&&e.clear()),this.fsQuad.render(e)}}); THREE.DigitalGlitch={uniforms:{tDiffuse:{value:null},tDisp:{value:null},byp:{value:0},amount:{value:.08},angle:{value:.02},seed:{value:.02},seed_x:{value:.02},seed_y:{value:.02},distortion_x:{value:.5},distortion_y:{value:.6},col_s:{value:.05}},vertexShader:"varying vec2 vUv;\nvoid main(){\n\tvUv=uv;\n\tgl_Position=projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",fragmentShader:"#if __VERSION__ < 130\n#define TEXTURE2D texture2D\n#else\n#define TEXTURE2D texture\n#endif\nuniform int byp;\nuniform sampler2D tDiffuse;\nuniform sampler2D tDisp;\nuniform float amount;\nuniform float angle;\nuniform float seed;\nuniform float seed_x;\nuniform float seed_y;\nuniform float distortion_x;\nuniform float distortion_y;\nuniform float col_s;\nvarying vec2 vUv;\nfloat rand (vec2 co){\n\treturn fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);\n}\nvoid main(){\n\tif(byp<1){\n\t\tvec2 p=vUv;\n\t\tfloat xs=floor(gl_FragCoord.x / 0.5);\n\t\tfloat ys=floor(gl_FragCoord.y / 0.5);\n\t\tvec4 normal=texture2D (tDisp, p*seed*seed);\n\t\tif(p.ydistortion_x-col_s*seed){\n\t\t\tif(seed_x>0.){\n\t\t\t\tp.y=1. - (p.y + distortion_y);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tp.y=distortion_y;\n\t\t\t}\n\t\t}\n\t\tif(p.xdistortion_y-col_s*seed){\n\t\t\tif(seed_y>0.){\n\t\t\t\tp.x=distortion_x;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tp.x=1. - (p.x + distortion_x);\n\t\t\t}\n\t\t}\n\t\tp.x+=normal.x*seed_x*(seed/5.);\n\t\tp.y+=normal.y*seed_y*(seed/5.);\n\t\tvec2 offset=amount * vec2(cos(angle), sin(angle));\n\t\tvec4 cr=TEXTURE2D(tDiffuse, p + offset);\n\t\tvec4 cga=TEXTURE2D(tDiffuse, p);\n\t\tvec4 cb=TEXTURE2D(tDiffuse, p - offset);\n\t\tgl_FragColor=vec4(cr.r, cga.g, cb.b, cga.a);\n\t\tvec4 snow=200.*amount*vec4(rand (vec2(xs * seed,ys * seed*50.))*0.2);\n\t\tgl_FragColor=gl_FragColor+ snow;\n\t}\n\telse {\n\t\tgl_FragColor=texture2D (tDiffuse, vUv);\n\t}\n}"}; THREE.GlitchPass=function(t,e){THREE.Pass.call(this),void 0===THREE.DigitalGlitch&&console.error("THREE.GlitchPass relies on THREE.DigitalGlitch");var s=THREE.DigitalGlitch;this.uniforms=THREE.UniformsUtils.clone(s.uniforms),"object"==typeof t&&(e={...t},t=64),"object"!=typeof t&&null!=t||(t=64),this.uniforms.tDisp.value=this.generateHeightmap(t),this.uniforms.damount=90,this.uniforms.dseed=.3,this.uniforms.drepeat=5,this.uniforms.dlen=120,e&&(e.damount&&(this.uniforms.damount=e.damount),e.dseed&&(this.uniforms.dseed=e.dseed),e.drepeat&&(this.uniforms.drepeat=e.drepeat),e.drepeat&&(this.uniforms.dlen=e.dlen)),this.material=new THREE.ShaderMaterial({uniforms:this.uniforms,vertexShader:s.vertexShader,fragmentShader:s.fragmentShader}),this.fsQuad=new THREE.Pass.FullScreenQuad(this.material),this.goWild=!1,this.curF=0,this.generateTrigger(this.uniforms.dlen)},THREE.GlitchPass.prototype=Object.assign(Object.create(THREE.Pass.prototype),{constructor:THREE.GlitchPass,render:function(t,e,s){this.uniforms.tDiffuse.value=s.texture,this.uniforms.seed.value=Math.random(),this.uniforms.byp.value=0,this.curF%this.randX.5?"t1":"t2"),"t1"===e?"1. - uv."+t:"uv."+t}function i(t){return 3==(t=tpGS.gsap.utils.splitColor(t)).length&&(t[3]=1),t[0]/=255,t[1]/=255,t[2]/=255,t}jQuery.extend(!0,t,{transitionpackInit:function(e,a){t.transitionPackUrl=void 0===a||window._R_is_Editor?RVS.ENV.TRANSITIONPACK_URL:a.url,THREE.Cache.enabled=!0},transitionPackUtils:{dplmlib:{1:{src:"transition/transition1.png"},2:{src:"transition/transition2.png"},3:{src:"transition/transition3.png"},4:{src:"transition/transition4.png"},5:{src:"transition/transition5.png"},6:{src:"transition/transition6.png"},7:{src:"displacement/disp1.jpg"},8:{src:"displacement/disp2.jpg"},9:{src:"displacement/disp3.jpg"},10:{src:"transition/transition7.png"},11:{src:"displacement/cracks.jpg"},12:{src:"displacement/tunnel.jpg"},13:{src:"displacement/waterfall.jpg"},14:{src:"displacement/wire.jpg"},15:{src:"displacement/zigzag.jpg"},16:{src:"displacement/paper.jpg"},17:{src:"transition/transition5v.png"}},addPASS:function(e,a){if(void 0!==t.postProcessing)switch(e.tpack.pp){case"glitches":e.tpack.ppga=parseFloat(e.tpack.ppga),e.tpack.ppgs=parseFloat(e.tpack.ppgs),e.tpack.ppgr=parseFloat(e.tpack.ppgr),e.tpack.ppgl=parseFloat(e.tpack.ppgl),e.three.postRendering=t.postProcessing[e.tpack.pp].init(e.three.renderer,e.three.scene,e.three.camera,{seed:e.tpack.ppgs,amount:e.tpack.ppga,repeat:e.tpack.ppgr,len:e.tpack.ppgl});break;case"glitch2":e.three.postRendering=t.postProcessing[e.tpack.pp].init(e.three.renderer,e.three.scene,e.three.camera,{duration:a.dur,width:e.mDIM.width,height:e.mDIM.height});break;case"blur":if("d3"===e.tpack.ppbt)e.tpack.ppbf=parseFloat(e.tpack.ppbf),e.tpack.ppbm=parseFloat(e.tpack.ppbm),e.tpack.ppba=parseFloat(e.tpack.ppba),e.three.postRendering=t.postProcessing[e.tpack.ppbt].init(e.three.renderer,e.three.scene,e.three.camera,{focus:e.tpack.ppbf,aperture:1e-4*e.tpack.ppba,maxblur:.001*e.tpack.ppbm,width:e.mDIM.width,height:e.mDIM.height});else if("motion"===e.tpack.ppbt){var r={};if("skew"==e.tpack.ef&&1==e.tpack.sh&&(r.name="m=qinticOut(m, 10.);",r.function="float qinticOut(float t, float power){ return 1.0 - pow(1. - t, power); }"),!isNaN(Math.round(e.tpack.smartX))&&!isNaN(Math.round(e.tpack.smartY))){e.three.postRendering=t.postProcessing[e.tpack.ppbt].init(e.three.renderer,e.three.scene,e.three.camera,{left:Math.round(e.tpack.smartX),top:Math.round(e.tpack.smartY),width:e.mDIM.width,height:e.mDIM.height},r);break}}break;case"film":e.tpack.ppfn=parseFloat(e.tpack.ppfn),e.tpack.ppfs=parseFloat(e.tpack.ppfs),e.tpack.ppfh=parseFloat(e.tpack.ppfh),e.tpack.ppfbw="true"==e.tpack.ppfbw||1==e.tpack.ppfbw&&"false"!=e.tpack.ppfbw,e.three.postRendering=t.postProcessing[e.tpack.pp].init(e.three.renderer,e.three.scene,e.three.camera,{noise:e.tpack.ppfn/100,scale:e.tpack.ppfs/100,size:e.tpack.ppfh,grayscale:e.tpack.ppfbw})}},fitCameraToObject:function(e){e.three.lastDim={width:e.mDIM.width,height:e.mDIM.height},e.three.camera.aspect=e.mDIM.width/e.mDIM.height,"cubetwist"===e.tpack.ef&&e.mDIM.height>e.mDIM.width&&(e.three.camera.aspect=e.mDIM.height/e.mDIM.width),e.three.CY=1/e.three.camera.aspect,e.three.camera.updateProjectionMatrix(),e.three.renderer.setSize(e.mDIM.width,e.mDIM.height,!1),t.transitionPackEffects[e.callFromAnimatedCanvasUpdateEffect].fit(e),e.three.camera.fov=2*Math.atan(e.three.CY/(2*e.three.camera.position.z))*(180/Math.PI),e.three.camera.updateProjectionMatrix()},webGlSceneUpdate:function(e){void 0!==e&&void 0!==e.three&&void 0!==e.three.canvas&&void 0!==e.three.camera&&(void 0!==e.three.lastDim&&e.three.lastDim.width===e.mDIM.width&&e.three.lastDim.height===e.mDIM.height||t.transitionPackUtils.fitCameraToObject(e),(e.video||e.panzoom)&&(e.three.texture.needsUpdate=!0),e.three.camera.updateProjectionMatrix(),e.three.renderer.render(e.three.scene,e.three.camera),e.three.postRendering&&e.three.postRendering.effectPass&&e.three.postRendering.effectPass.uniforms&&e.three.postRendering.effectPass.uniforms.progress&&(e.three.postRendering.effectPass.uniforms.progress.value=e.three.progress.value),e.three.postRendering&&e.three.postRendering.composer&&e.three.postRendering.composer.render(),e.three.postRendering&&e.three.postRendering.nodepost&&e.postRendering.nodepost.render(e.three.scene,e.three.camera,e.postRendering.frame),"spin"!==e.tpack.ef&&"rings"!==e.tpack.ef&&"perspective"!==e.tpack.ef&&"zoom"!==e.tpack.ef&&"blur"!==e.tpack.ef||void 0===e.tpack.ao||"none"===e.tpack.ao||function(t){var e=parseFloat(t.tpack.ox)/100,a=parseFloat(t.tpack.oy)/100;if("center"===t.tpack.ao)e+=(1-e-.5)*t.three.progress.value,a+=(1-a-.5)*t.three.progress.value;else if("inverse"===t.tpack.ao)e+=(1-e-e)*t.three.progress.value,a+=(1-a-a)*t.three.progress.value;else{var r="";t.tpack.ao,r="M0,0 C0,31 12.502,53.904 21,71.666 23.297,76.474 41.612,87.014 41.612,87.014 41.612,87.014 55.195,91.292 59.191,89.37 65.079,86.535 74.337,76.113 76.821,70.068 79.289,64.058 79.603,50.337 77.786,44.101 76.012,38.014 68.806,26.324 63.206,23.354 58.575,20.897 46.201,21.762 42.33,25.295 38.918,28.407 39.793,39.227 40.895,43.712 41.873,47.695 50.179,57.243 50.179,57.243";var i={x:0,y:0},s=tpGS.gsap.to(i,{motionPath:{path:r},ease:"none"});s.pause().progress(t.three.progress.value),e=i.x/100,a=1-i.y/100,s.kill(),s=null}"perspective"===t.tpack.ef&&(t.three.material.uniforms.angle.value=Math.atan2(.5-e,.5-a));t.three.material.uniforms.ox.value=e,t.three.material.uniforms.oy.value=a}(e))},getWebGLCanvas:function(){let t=document.createElement("canvas");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.zIndex=2,t.width=1600,t.height=1200,{canvas:t}},getEndRotation:function(e,a,r){let i=90*t.SATools.getSpecialValue(t.valBeau(e),a,r);return i=tpGS.gsap.utils.snap(90,i<0?Math.min(-90,i):Math.max(90,i)),i=i%360==0?i+90:i,i=0===i?90:i,i},getPlane:function(t,e){return new THREE.Mesh(new THREE.PlaneGeometry(1,1,2,2),e)},getCube:function(e,a,r,i,s){let n;return"col"===e?(n=new THREE.Mesh(new THREE.BoxBufferGeometry(a,1,1),r),n.position.x=i*a-(.5-a/2),t.transitionPackUtils.cubeSidesUV(n.geometry.attributes.uv,a,1,1,i,0,0,e)):(n=new THREE.Mesh(new THREE.BoxBufferGeometry(1,a,1),r),n.position.y=i*a*s-(.5*s-a*s/2),t.transitionPackUtils.cubeSidesUV(n.geometry.attributes.uv,1,a,1,0,i,0,e)),n},cubeSidesUV:function(t,e,a,r,i,s,n,o){t.setXY(0,n*r,(s+1)*a),t.setXY(1,(n+1)*r,(s+1)*a),t.setXY(2,n*r,s*a),t.setXY(3,(n+1)*r,s*a),t.setXY(4,n*r,(s+1)*a),t.setXY(5,(n+1)*r,(s+1)*a),t.setXY(6,n*r,s*a),t.setXY(7,(n+1)*r,s*a),t.setXY(8,i*e,r),t.setXY(9,(i+1)*e,r),t.setXY(10,i*e,0),t.setXY(11,(i+1)*e,0),t.setXY(12,i*e,r),t.setXY(13,(i+1)*e,r),t.setXY(14,i*e,0),t.setXY(15,(i+1)*e,0),t.setXY(16,i*e,(s+1)*a),t.setXY(17,(i+1)*e,(s+1)*a),t.setXY(18,i*e,s*a),t.setXY(19,(i+1)*e,s*a),"row"===o?(t.setXY(20,i*e,(s+1)*a),t.setXY(21,(i+1)*e,(s+1)*a),t.setXY(22,i*e,s*a),t.setXY(23,(i+1)*e,s*a)):(t.setXY(20,(i+1)*e,s*a),t.setXY(21,i*e,s*a),t.setXY(22,(i+1)*e,(s+1)*a),t.setXY(23,i*e,(s+1)*a)),t.needsUpdate=!0},getTpackDatas:function(t,e){if(void 0===e||""==e)return{};var a,r={},i=e.split(";");for(var s in i)i.hasOwnProperty(s)&&void 0!==(a=i[s].split(":"))[0]&&void 0!==a[1]&&(r[a[0]]=a[1]);return r}},transitionPackEffects:{defaults:function(){return{tpack:{sx:1,sy:1,sz:1,o:0,sr:1,rx:180,ry:180,rz:90,col:1,row:1,cgz:250,gz:250,gx:0,gy:0,ie:"power2.inOut",ige:"power2.inOut",pp:"none",ppbf:100,ppbm:4,ppba:20,ppbt:"motion",ppga:90,ppgr:5,ppgs:.3,ppgl:120,ppfn:80,ppfs:82,ppfh:256,ppfbw:!1,ef:"fade",dplm:1,mfl:0,dir:0,dbas:!1,tlt:0,rad:90,w:35,iny:1,x:0,y:0,z:250,td:1,ref:.4,flo:30,twe:"simple",twa:0,twv:230,twz:30,twd:"left",twdi:30,tws:"rgba(0, 0, 0, 0.7)",twf:"rgba(0, 0, 0, 0.7)",prange:100,stri:30,strs:1,strf:1,sko:0,sh:!1,shx:0,shy:0,shz:0,shr:0,shv:80,roz:-2,ox:50,oy:50,cicl:"rgba(0, 0, 0, 0.3)",cish:0,cispl:4,cimw:!1,cio:"alternate",cico:!1,ciad:!1,chm1:"random",chm2:"random",chm3:"random",chm4:"random"}}},tpbasic:{build:function(t,e){var a=t.three;a.CY=1/a.camera.aspect,a.scene.remove(a.light),a.light=new THREE.AmbientLight("#ffffff",1),a.scene.add(a.light),a.texture=new THREE.CanvasTexture(t.shadowCanvas),a.texture.wrapS=THREE.RepeatWrapping,a.texture.wrapT=THREE.RepeatWrapping,a.texture.repeat.set(1,1),window._R_is_Editor||void 0===e.BG||(a.texture_leaving=new THREE.CanvasTexture(e.BG.shadowCanvas),a.texture_leaving.wrapS=THREE.RepeatWrapping,a.texture_leaving.wrapT=THREE.RepeatWrapping,a.texture_leaving.repeat.set(1,1),a.material_leaving=new THREE.MeshPhongMaterial({transparent:!0,map:a.texture_leaving}))},init:function(e,a,r,i){e.tpack.ef="fadeb"===e.tpack.ef?"fade":e.tpack.ef,t.transitionPackEffects.tpbasic.build(e,r);var s=t.transitionPackEffects.tpbasic.getUniforms(e,r.sdir),n=window.TP_SHDRS[e.tpack.ef];"chaos"===e.tpack.ef&&(n=n.replace("#replaceChaos",s.replace),delete s.replace);var o={extensions:{derivatives:"#extension GL_OES_standard_derivatives:enable"},side:THREE.DoubleSide,uniforms:jQuery.extend(!0,{src1:{value:e.three.texture_leaving},src2:{value:e.three.texture},progress:{value:0},threshold:{value:.1},resolution:{value:new THREE.Vector4}},s),vertexShader:"varying vec2 vUv;void main(){vUv=uv;gl_Position=projectionMatrix * modelViewMatrix * vec4(position, 1.0);}",fragmentShader:n};void 0!==s.defines&&(o.defines=s.defines,delete s.defines),o.fragmentShader="#if __VERSION__ < 130 \n#define TEXTURE2D texture2D \n#else \n#define TEXTURE2D texture \n#endif\n"+o.fragmentShader,e.three.material=new THREE.ShaderMaterial(o),t.transitionPackEffects.tpbasic.planeAndFit(e),t.transitionPackUtils.addPASS(e,a),t.transitionPackEffects.tpbasic.updateResolution(e)},getUniforms:function(e,s){let n;switch(e.tpack.smartX=t.SATools.getSpecialValue(t.valBeau(e.tpack.x),void 0,s),e.tpack.smartY=t.SATools.getSpecialValue(t.valBeau(e.tpack.y),void 0,s),e.tpack.smartZ=t.SATools.getSpecialValue(t.valBeau(e.tpack.z),void 0,s),e.tpack.smartTilt=t.SATools.getSpecialValue(t.valBeau(e.tpack.tlt),void 0,s),e.tpack.smartIntensity=t.SATools.getSpecialValue(t.valBeau(e.tpack.iny),void 0,s),1==e.tpack.dbas&&(e.tpack.dir=1===s?e.tpack.dir:0==e.tpack.dir?1:1==e.tpack.dir?0:2==e.tpack.dir?3:2),e.tpack.ef){case"fade":let b=void 0!==e.tpack.mfl&&0!=e.tpack.mfl&&(1==e.tpack.mfl||1!==s),P=17==e.tpack.dplm||6==e.tpack.dplm;n={flipx:{value:!P&&b},flipy:{value:!!P&&b},src1:{value:e.three.texture},src2:void 0===e.three.texture_leaving?{value:0}:{value:e.three.texture_leaving},displacement:{value:(new THREE.TextureLoader).load(t.transitionPackUrl+"public/assets/textures/"+t.transitionPackUtils.dplmlib[e.tpack.dplm].src)}};break;case"wave":n={radius:{value:parseInt(e.tpack.rad)/100,min:.1,max:2},width:{value:parseInt(e.tpack.w)/100,min:0,max:1},displacement:{value:(new THREE.TextureLoader).load(t.transitionPackUrl+"public/assets/textures/"+t.transitionPackUtils.dplmlib[e.tpack.dplm].src)}};break;case"burnover":n={displacement:{value:(new THREE.TextureLoader).load(t.transitionPackUrl+"public/assets/textures/"+t.transitionPackUtils.dplmlib[e.tpack.dplm].src)}};break;case"burn":n={intensity:{value:.03*parseFloat(e.tpack.smartIntensity)},dir:{value:e.tpack.dir}};break;case"chaos":var o="vw.x="+r("y",e.tpack.chm1)+" * "+r("x",e.tpack.chm2)+" * intensity; vw.y="+r("x",e.tpack.chm3)+" * "+r("y",e.tpack.chm4)+" * intensity;";n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},left:{value:Math.round(e.tpack.smartX)},top:{value:Math.round(e.tpack.smartY)},intensity:{value:parseFloat(e.tpack.smartIntensity)/10},prange:{value:parseInt(e.tpack.prange)/100*.5},replace:o};break;case"stretch":var l=parseInt(e.tpack.strs)/10,p=l<1?tpGS.gsap.utils.mapRange(0,1,100,10,l):tpGS.gsap.utils.mapRange(1,10,10,2,l);n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},left:{value:Math.round(e.tpack.smartX)},top:{value:0==e.tpack.smartX?Math.round(e.tpack.smartY):0},dir:{value:0==e.tpack.smartX?2:1},intensity:{value:e.tpack.smartIntensity},twistIntensity:{value:parseInt(e.tpack.stri)/10},twistSize:{value:p},flipTwist:{value:e.tpack.strf?-1:1}};break;case"skew":var c=0!=e.tpack.smartX&&0!=e.tpack.smartY?0:0==e.tpack.smartX?2:1,u=t.SATools.getSpecialValue(t.valBeau(e.tpack.shr));n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},left:{value:Math.round(e.tpack.smartX)},top:{value:Math.round(e.tpack.smartY)},dir:{value:c},intensity:{value:e.tpack.smartIntensity/100*(0==c?10:30)},origin:{value:parseInt(e.tpack.sko)/100},prange:{value:parseInt(e.tpack.prange)/100*.5},sh:{value:e.tpack.sh},shx:{value:t.SATools.getSpecialValue(t.valBeau(e.tpack.shx),void 0,s)/100},shy:{value:t.SATools.getSpecialValue(t.valBeau(e.tpack.shy),void 0,s)/100},shz:{value:t.SATools.getSpecialValue(t.valBeau(e.tpack.shz),void 0,s)/50},shr:{value:0===u?0:a(u)},shv:{value:tpGS.gsap.utils.mapRange(0,100,6,1,parseInt(e.tpack.shv))}};break;case"perspective":var d=parseInt(e.tpack.ox)/100,v=parseInt(e.tpack.oy)/100,m=Math.atan2(.5-d,.5-v),h=t.SATools.getSpecialValue(t.valBeau(e.tpack.roz),void 0,s);n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},ox:{value:d},oy:{value:v},intensity:{value:parseInt(e.tpack.pr)},rotation:{value:a(180*Math.round(h,void 0,s))},isShort:{value:h%2!=0},angle:{value:m},prange:{value:parseInt(e.tpack.prange)/100*.5}};break;case"spin":d=parseInt(e.tpack.ox)/100,v=parseInt(e.tpack.oy)/100;var g=0===e.tpack.smartIntensity?0:e.tpack.smartIntensity/100,f=(h=Math.round(t.SATools.getSpecialValue(t.valBeau(e.tpack.roz),void 0,s)),-e.tpack.smartZ);n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},ox:{value:d},oy:{value:v},intensity:{value:g},roz:{value:h},zoom:{value:f>0?f/10:f/100},isShort:{value:h%2!=0},prange:{value:parseInt(e.tpack.prange)/100*.5}};break;case"rings":d=parseInt(e.tpack.ox)/100,v=parseInt(e.tpack.oy)/100,g=0===e.tpack.smartIntensity?0:e.tpack.smartIntensity/10,h=Math.round(t.SATools.getSpecialValue(t.valBeau(e.tpack.roz),void 0,s));var k="none"!=e.tpack.cio,w="none"==e.tpack.cio||"alternate"==e.tpack.cio?0:"grad"==e.tpack.cio?1:2,x=i(e.tpack.cicl);g=11-g,n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},ox:{value:d},oy:{value:v},iny:{value:g},roz:{value:h},isShort:{value:h%2!=0},Splits:{value:e.tpack.cispl},iColor:{value:x},s:{value:parseInt(e.tpack.cish)/100},useo:{value:k},grado:{value:w},cover:{value:e.tpack.cico},altDir:{value:e.tpack.ciad},cnprog:{value:e.tpack.cimw},prange:{value:parseInt(e.tpack.prange)/100*.5},defines:{splits:e.tpack.cispl}};break;case"zoom":d=parseInt(e.tpack.ox)/100,v=parseInt(e.tpack.oy)/100,h=Math.round(t.SATools.getSpecialValue(t.valBeau(e.tpack.roz),void 0,s));var E=-parseFloat(e.tpack.zi),R=-parseFloat(e.tpack.zo),y=parseFloat(e.tpack.zwo),S=parseFloat(e.tpack.zwi);n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},ox:{value:d},oy:{value:v},roz:{value:h},isShort:{value:h%2!=0},zOut:{value:R>0?R/10:R/100},zIn:{value:E>0?E/10:E/100},blur:{value:parseFloat(e.tpack.zb)/100},warpOut:{value:0===y?0:tpGS.gsap.utils.mapRange(0,100,10,.5,y)},warpIn:{value:0===S?0:tpGS.gsap.utils.mapRange(0,100,10,.5,parseFloat(S))},prange:{value:parseInt(e.tpack.prange)/100*.3*.5},rEnd:{value:parseFloat(e.tpack.zre)/100}};break;case"cut":n={dir:{value:e.tpack.dir},width:{value:parseInt(e.tpack.w)/10,min:0,max:10},scaleX:{value:parseInt(e.tpack.ssx)/100*60,min:.1,max:60},scaleY:{value:parseInt(e.tpack.ssy)/100*60,min:.1,max:60},displacement:{value:(new THREE.TextureLoader).load(t.transitionPackUrl+"public/assets/textures/"+t.transitionPackUtils.dplmlib[e.tpack.dplm].src)}};break;case"flat":n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},left:{value:Math.round(e.tpack.smartX)},top:{value:Math.round(e.tpack.smartY)},tilt:{value:e.tpack.smartTilt/100},zoom:{value:e.tpack.smartZ/100},prange:{value:parseInt(e.tpack.prange)/100*.5}};break;case"pano":n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},left:{value:Math.round(e.tpack.smartX)},top:{value:Math.round(e.tpack.smartY)},tilt:{value:e.tpack.smartTilt/100},pano:{value:1-e.tpack.smartIntensity/100},zoomOut:{value:e.tpack.smartZ/100},prange:{value:parseInt(e.tpack.prange)/100*.5}};break;case"overroll":n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},dir:{value:e.tpack.dir},intensity:{value:.01*e.tpack.smartIntensity},displacement:{value:(new THREE.TextureLoader).load(t.transitionPackUrl+"public/assets/textures/"+t.transitionPackUtils.dplmlib[e.tpack.dplm].src)}};break;case"water":n={intensity:{value:e.tpack.smartIntensity/100*10,min:0,max:10}};break;case"colorflow":var _=Math.round(e.tpack.smartX),T=Math.round(e.tpack.smartY);n={angle:{value:m=Math.atan2(_,T)-a(45)},left:{value:_=Math.abs(_)},top:{value:T=Math.abs(T)},intensity:{value:e.tpack.smartIntensity/100*3,min:0,max:3},displacement:{value:(new THREE.TextureLoader).load(t.transitionPackUrl+"public/assets/textures/"+t.transitionPackUtils.dplmlib[e.tpack.dplm].src)}};break;case"zoomover":n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},intensity:{value:e.tpack.smartIntensity/100,min:0,max:3}};break;case"morph":n={left:{value:Math.round(e.tpack.smartX)},top:{value:Math.round(e.tpack.smartY)},src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},intensity:{value:e.tpack.smartIntensity/100,min:0,max:1}};break;case"blur":d=parseInt(e.tpack.ox)/100,v=parseInt(e.tpack.oy)/100,h=Math.round(t.SATools.getSpecialValue(t.valBeau(e.tpack.roz),void 0,s)),E=-parseFloat(e.tpack.zi),R=-parseFloat(e.tpack.zo);n={left:{value:Math.round(e.tpack.smartX)},top:{value:Math.round(e.tpack.smartY)},ox:{value:d},oy:{value:v},roz:{value:h},isShort:{value:h%2!=0},zOut:{value:R>0?R/10:R/100},zIn:{value:E>0?E/10:E/100},prange:{value:parseInt(e.tpack.prange)/100*.3*.5},rEnd:{value:parseFloat(e.tpack.zre)/100},src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},intensity:{value:e.tpack.smartIntensity/100,min:0,max:1}};break;case"waterdrop":n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},speed:{value:e.tpack.smartIntensity},amplitude:{value:parseInt(e.tpack.rad)}};break;case"mosaic":n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},endx:{value:e.tpack.smartX,min:-50,max:50},endy:{value:e.tpack.smartY,min:-50,max:50}};break;case"mirrorcube":n={src1:window._R_is_Editor?{value:e.three.texture}:{value:e.three.texture_leaving},persp:{value:.7},unzoom:{value:parseFloat(e.tpack.gz)/100},reflection:{value:e.tpack.ref},floating:{value:parseFloat(e.tpack.flo)/10}}}return n||{}},planeAndFit:function(e){e.three.plane=t.transitionPackUtils.getPlane(e,e.three.material,e.three.CY),e.three.scene.add(e.three.plane),t.transitionPackUtils.fitCameraToObject(e)},updateResolution:function(t){t.three.material.uniforms.resolution.value.x=t.mDIM.width,t.three.material.uniforms.resolution.value.y=t.mDIM.height,t.three.material.uniforms.resolution.value.z=1,t.three.material.uniforms.resolution.value.w=1,t.three.imageAspect=t.three.texture.image.height/t.three.texture.image.width,t.video||t.panzoom||(t.mDIM.height/t.mDIM.width>this.imageAspect?t.three.material.uniforms.resolution.value.z=t.mDIM.width/t.mDIM.height*t.three.imageAspect:t.three.material.uniforms.resolution.value.w=t.mDIM.height/t.mDIM.width/t.three.imageAspect)},extendTL:function(t,e,a,r){var i=new tpGS.gsap.timeline;return e.three.progress={value:1},i.add(tpGS.gsap.from(e.three.progress,a.dur,{value:0,delay:.05,ease:e.tpack.ie})),i},tick:function(t){t.three.material.uniforms.progress.value=t.three.progress.value},fit:function(t){t.three.plane.scale.set(1,t.three.CY)}},cube:{init:function(e,a,r,i){var s=e.three;if(s.splitdir=e.tpack.col<=1||void 0===e.tpack.col?"row":"col",s.split="row"==s.splitdir?e.tpack.row||1:e.tpack.col||1,s.divto=1/s.split,s.light=new THREE.SpotLight(16777215,1.1),s.light.position.set(5,5,10),s.light.castShadow=!0,s.scene.add(s.light),s.cubes=[s.split],s.texture=new THREE.CanvasTexture(e.shadowCanvas),s.texture.wrapS=THREE.RepeatWrapping,s.texture.wrapT=THREE.RepeatWrapping,s.texture.repeat.set(1,1),window._R_is_Editor||void 0===r.BG)s.material=new THREE.MeshPhongMaterial({transparent:!0,map:s.texture});else{s.texture_leaving=new THREE.CanvasTexture(r.BG.shadowCanvas),s.texture_leaving.wrapS=THREE.RepeatWrapping,s.texture_leaving.wrapT=THREE.RepeatWrapping,s.texture_leaving.repeat.set(1,1);var n=new THREE.MeshPhongMaterial({transparent:!0,map:s.texture}),o=new THREE.MeshPhongMaterial({transparent:!0,map:s.texture_leaving});let a={col:{90:3,180:5,270:2,"-90":2,"-180":5,"-270":3},row:{90:0,180:5,270:1,"-90":1,"-180":5,"-270":0}};s.material=[n,o,o,n,o,n];let i=t.transitionPackUtils.getEndRotation(e.tpack.sr,0,r.sdir)%360;s.material[a[s.splitdir][i]]=n}s.GRP=new THREE.Group,s.CY=1/s.camera.aspect;for(var l=0;la.mDIM.width,l.texture=new THREE.CanvasTexture(a.shadowCanvas),l.texture.wrapS=THREE.RepeatWrapping,l.texture.wrapT=THREE.RepeatWrapping,l.texture.repeat.set(1,1),window._R_is_Editor||void 0===s.BG)l.material=e({transparent:!0,map:l.texture,opt:o,coming:l.texture});else{l.texture_leaving=new THREE.CanvasTexture(s.BG.shadowCanvas),l.texture_leaving.wrapS=THREE.RepeatWrapping,l.texture_leaving.wrapT=THREE.RepeatWrapping,l.texture_leaving.repeat.set(1,1);var p=e({transparent:!0,map:l.texture,opt:o,coming:l.texture,leaving:l.texture_leaving}),c=e({transparent:!0,map:l.texture_leaving,opt:o,coming:l.texture,leaving:l.texture_leaving});l.material=[c,c,c,c,p,c]}l.cube=new THREE.Mesh(new THREE.BoxBufferGeometry(1,1,1,64,64,64),l.material),l.GRP=new THREE.Group,l.CY=1/l.camera.aspect,l.GRP.add(l.cube),t.transitionPackUtils.fitCameraToObject(a),l.scene.add(l.GRP),t.transitionPackUtils.addPASS(a,r),l.cube.scale.set(1,1/l.camera.aspect,1/l.camera.aspect)},extendTL:function(t,e,r,i){var s=e.tpack,n="simple"!==s.twe,o=e.three.cube,l=e.three.GRP,p=s.ie,c=a(s.twv),u=s.twc?1:.7;u="right"===s.twd?u:-u;var d=new tpGS.gsap.timeline({onUpdate:function(){var t;if(s.twf&&(t=Math.abs(e.three.cube.position.z+e.three.GRP.position.z)+e.three.camera.position.z,t-=.3*(t-50)/s.twz*-1),e.three.cube.material.length)for(var a=0;a0;)a.three.scene.remove(a.three.scene.children[0]);null!==a.three.canvas.parentNode&&a.three.canvas.parentNode.removeChild(a.three.canvas)}a.three=t.transitionPackUtils.getWebGLCanvas(),window._R_is_Editor||void 0===i.BG?a.canvas.parentNode.appendChild(a.three.canvas):i.BG.canvas.parentNode.appendChild(a.three.canvas),a.canvas.style.display="none",a.three.planeAspectRatio=16/9,a.three.fov=150,a.callFromAnimatedCanvasUpdate=t.transitionPackUtils.webGlSceneUpdate,a.callFromAnimatedCanvasUpdateEffect=i.effect,t.animatedCanvasUpdate(e,a),a.three.renderer=new THREE.WebGLRenderer({canvas:a.three.canvas,alpha:!0}),a.three.renderer.setClearColor(16777215,0),a.three.camera=new THREE.PerspectiveCamera(a.three.fov,a.three.canvas.width/a.three.canvas.height,.1,1e3),a.three.camera.position.z=50,a.three.scene=new THREE.Scene,t.transitionPackEffects[i.effect].init(a,r,i,e);var s=tpGS.gsap.timeline({onUpdate:function(){window._R_is_Editor&&(a.canvas.style.display="none",tpGS.gsap.set(a.three.canvas,{autoAlpha:1}),i.BG&&(i.BG.canvas.style.display="none")),t.transitionPackEffects[i.effect].tick(a,i),t.transitionPackUtils.webGlSceneUpdate(a)},onStart:function(){i.BG&&(i.BG.canvas.style.display="none")},onComplete:function(){t.slideAnimFinished(e,a,{direction:"in",BG:i.BG,slide:i.slide},!0),tpGS.gsap.set(i.slide,{zIndex:20}),void 0!==i.BG&&t.slideAnimFinished(e,i.BG,{direction:"out",slide:i.outslide}),delete a.callFromAnimatedCanvasUpdate,void 0!==i.BG&&(i.BG.canvas.style.display="block",i.BG.canvas.style.opacity=0),t.updateSlideBGs(e),tpGS.gsap.to(a.three.canvas,.3,{autoAlpha:0,onStart:function(){a.canvas.style.display="block",i.BG&&tpGS.gsap.set(i.outslide,{zIndex:10})},onComplete:function(){if(!window._R_is_Editor){for(;a.three.scene.children.length>0;)a.three.scene.remove(a.three.scene.children[0]);null!==a.three.canvas.parentNode&&a.three.canvas.parentNode.removeChild(a.three.canvas),void 0!==i.BG&&i.BG.ctx.clearRect(0,0,2*a.canvas.width,2*a.canvas.height)}}})}});s.add(t.transitionPackEffects[i.effect].extendTL(e,a,r,i),0),window._R_is_Editor?RVS.TL[RVS.S.slideId].slide.add(s,0):t[e].mtl.add(s,i.delay)}}}),window.RS_MODULES=window.RS_MODULES||{},window.RS_MODULES.tpack={loaded:!0,version:"3.0.0"},window.RS_MODULES.checkMinimal&&window.RS_MODULES.checkMinimal()}(); var EGallery=function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=9)}([function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function i(t,e){for(var i=0;i0&&void 0!==arguments[0]&&arguments[0],e=this.settings.tags,i=[];if(!e.length)return t?(this.$items.each(function(t){i.push(t)}),i):this.$items;var n=this.$items.filter(function(n,s){var r=s.dataset.eGalleryTags;return!!r&&(r=r.split(/[ ,]+/),!!e.some(function(t){return r.includes(t)})&&(t&&i.push(n),!0))});return t?i:n}},{key:"getImageData",value:function(t){return this.settings.tags.length&&(t=this.getActiveItems(!0)[t]),this.imagesData[t]}},{key:"compileTemplate",value:function(t,e){var i=this;return t.replace(/{{([^}]+)}}/g,function(t,n){return i.getTemplateArgs(e,n.trim())})}},{key:"createOverlay",value:function(t){var e=this.settings,i=e.classes,n=e.overlayTemplate,s=jQuery("
",{class:this.getItemClass(i.overlay)}),r=this.compileTemplate(n,jQuery.extend(!0,this.settings,t));return s.html(r),s}},{key:"createItem",value:function(t){var e,i=this.settings.classes,n=jQuery("
",{class:this.getItemClass(i.item),"data-e-gallery-tags":t.tags}),s=jQuery("
",{class:this.getItemClass(i.image)});this.settings.lazyLoad||s.css("background-image","url("+t.thumbnail+")"),this.settings.overlay&&(e=this.createOverlay(t));var r=n;return t.url&&(r=jQuery("",{class:this.getItemClass(i.link),href:t.url}),n.html(r)),r.html(s),e&&r.append(e),n}},{key:"debounce",value:function(t,e){var i,n=this;return function(){for(var s=arguments.length,r=new Array(s),a=0;a1&&void 0!==arguments[1]?arguments[1]:"top",i=t.getBoundingClientRect().top,n=t.offsetHeight,s=i+n;return("middle"===e?i+n/2:"bottom"===e?s:i)<=innerHeight&&s>=0}(n))return!0;s.loading=!0;var r=jQuery(n),a=new Image;return new Promise(function(t){a.onload=t}).then(function(){r.find(t.settings.selectors.image).css("background-image",'url("'+s.thumbnail+'")').addClass(t.getItemClass(t.settings.classes.imageLoaded)),t.loadedItemsCount++,t.loadedItemsCount===t.settings.items.length&&(t.lazyLoadComplete=!0)}),a.src=s.thumbnail,!0})}}},{key:"calculateImageSize",value:function(t,e){this.imagesData[e]={width:t.width,height:t.height,ratio:t.width/t.height}}},{key:"createImagesData",value:function(){var t=this;this.settings.items.forEach(function(e,i){return t.calculateImageSize(e,i)})}},{key:"makeGalleryFromContent",value:function(){var t=this.settings.selectors,e=this.settings.lazyLoad,i=[];this.$items=this.$container.find(t.items),this.$items.each(function(n,s){var r=jQuery(s).find(t.image);i[n]={thumbnail:r.data("thumbnail")},e?(i[n].width=r.data("width"),i[n].height=r.data("height")):r.css("background-image",'url("'.concat(r.data("thumbnail"),'")'))}),this.settings.items=i}},{key:"prepareGallery",value:function(){this.settings.items?this.buildGallery():this.makeGalleryFromContent(),this.imagesData=[],this.settings.lazyLoad?(this.loadedItemsCount=0,this.lazyLoadComplete=!1,this.createImagesData()):this.loadImages()}},{key:"runGallery",value:function(t){var e=this,i=this.$container[0].style;i.setProperty("--hgap",this.getCurrentDeviceSetting("horizontalGap")+"px"),i.setProperty("--vgap",this.getCurrentDeviceSetting("verticalGap")+"px"),i.setProperty("--animation-duration",this.settings.animationDuration+"ms"),this.$items.addClass(this.getItemClass(this.settings.classes.hidden)),this.getActiveItems().removeClass(this.getItemClass(this.settings.classes.hidden)),this.settings.lazyLoad&&setTimeout(function(){return e.lazyLoadImages()},300),this.run(t)}},{key:"setSettings",value:function(t,e){var i=this.getNestedObjectData(this.settings,t);i.object&&(i.object[i.key]=e,this.runGallery(!0))}},{key:"unbindEvents",value:function(){this.elements.$window.off("resize",this.runGallery)}},{key:"destroy",value:function(){this.unbindEvents(),this.$container.empty(),this.timeouts.forEach(function(t){return clearTimeout(t)})}}]),t}(),f=function(t){function e(){return s()(this,e),l()(this,c()(e).apply(this,arguments))}return y()(e,t),a()(e,[{key:"getDefaultSettings",value:function(){return{aspectRatio:"16:9"}}},{key:"setItemsPosition",value:function(){var t=this.getCurrentDeviceSetting("columns");this.getActiveItems().each(function(e,i){i.style.setProperty("--column",e%t),i.style.setProperty("--row",Math.floor(e/t))})}},{key:"setContainerSize",value:function(){var t=this.getCurrentDeviceSetting("columns"),e=Math.ceil(this.getActiveItems().length/t),i=this.$container[0].style;i.setProperty("--columns",t),i.setProperty("--rows",e);var n=this.getActiveItems().width(),s=this.settings.aspectRatio.split(":"),r=s[1]/s[0],a=(r*n*e+this.getCurrentDeviceSetting("horizontalGap")*(e-1))/this.$container.width()*100;i.setProperty("--aspect-ratio",100*r+"%"),i.setProperty("--container-aspect-ratio",a+"%")}},{key:"run",value:function(){var t=this,e=this.getItemClass(this.settings.classes.animated);this.$container.addClass(e),setTimeout(function(){t.setItemsPosition(),t.setContainerSize(),setTimeout(function(){return t.$container.removeClass(e)},t.settings.animationDuration)},50)}}]),e}(g),m=function(t){function e(){return s()(this,e),l()(this,c()(e).apply(this,arguments))}return y()(e,t),a()(e,[{key:"getDefaultSettings",value:function(){return{idealRowHeight:200,lastRow:"auto",breakpoints:{1024:{idealRowHeight:150},768:{idealRowHeight:100}}}}},{key:"run",value:function(){this.rowsHeights=[],this.rowsCount=0,this.containerWidth=this.$container.width(),this.makeJustifiedRow(0)}},{key:"makeJustifiedRow",value:function(t){for(var e=0,i=t;;i++){var n=this.getImageData(i),s=Math.round(this.getCurrentDeviceSetting("idealRowHeight")*n.ratio);s>this.containerWidth&&(s=this.containerWidth);var r=e+s;if(r>this.containerWidth)if(this.containerWidth-ee+5&&(c=e,h=t)}),r[t]=n[h],n[h]+=u,i.style.setProperty("--item-height",o.height/o.width*100+"%"),i.style.setProperty("--column",h),i.style.setProperty("--items-in-column",s[h]),s[h]++});var y=Math.max.apply(Math,n),g=n.indexOf(y),f=s[g]-1,m=y/o;this.$container[0].style.setProperty("--columns",a),this.$container[0].style.setProperty("--highest-column-gap-count",f),this.$container.css("padding-bottom",100*m+"%"),u.each(function(t,e){var i=r[t]?r[t]/y*100:0;e.style.setProperty("--percent-height",i+"%")})}}}]),e}(g);i(8);i.d(e,"default",function(){return p});var p=function(){function t(e){s()(this,t),this.userSettings=e,this.initGalleriesTypes(),this.createGallery()}return a()(t,[{key:"getDefaultSettings",value:function(){return{container:null,items:null,type:"grid",tags:[],overlay:!1,overlayTemplate:'
{{ title }}
{{ description }}
',columns:5,horizontalGap:10,verticalGap:10,rtl:!1,animationDuration:350,lazyLoad:!1,classesPrefix:"e-gallery-",classes:{container:"container",item:"item",image:"image",overlay:"overlay",overlayTitle:"overlay__title",overlayDescription:"overlay__description",link:"link",firstRowItem:"first-row-item",animated:"-animated",hidden:"item--hidden",lazyLoad:"-lazyload",imageLoaded:"image-loaded"},selectors:{items:".e-gallery-item",image:".e-gallery-image"},breakpoints:{1024:{horizontalGap:5,verticalGap:5,columns:4},768:{horizontalGap:1,verticalGap:1,columns:2}}}}},{key:"initGalleriesTypes",value:function(){this.galleriesTypes={grid:f,justified:m,masonry:d}}},{key:"createGallery",value:function(){var t=jQuery.extend(this.getDefaultSettings(),this.userSettings),e=this.galleriesTypes[t.type];this.galleryHandler=new e(t)}},{key:"setSettings",value:function(t,e){this.galleryHandler.setSettings(t,e)}},{key:"destroy",value:function(){this.galleryHandler.destroy()}}]),t}()}]).default; !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use strict";function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function r(t){return"string"==typeof t}function s(t){return"function"==typeof t}function t(t){return"number"==typeof t}function u(t){return void 0===t}function v(t){return"object"==typeof t}function w(t){return!1!==t}function x(){return"undefined"!=typeof window}function y(t){return s(t)||r(t)}function P(t){return(i=yt(t,ot))&&Ee}function Q(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")}function R(t,e){return!e&&console.warn(t)}function S(t,e){return t&&(ot[t]=e)&&i&&(i[t]=e)||ot}function T(){return 0}function ea(t){var e,r,i=t[0];if(v(i)||s(i)||(t=[t]),!(e=(i._gsap||{}).harness)){for(r=gt.length;r--&&!gt[r].targetTest(i););e=gt[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Vt(t[r],e)))||t.splice(r,1);return t}function fa(t){return t._gsap||ea(Ot(t))[0]._gsap}function ga(t,e,r){return(r=t[e])&&s(r)?t[e]():u(r)&&t.getAttribute&&t.getAttribute(e)||r}function ha(t,e){return(t=t.split(",")).forEach(e)||t}function ia(t){return Math.round(1e5*t)/1e5||0}function ja(t){return Math.round(1e7*t)/1e7||0}function ka(t,e){var r=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),"+"===r?t+i:"-"===r?t-i:"*"===r?t*i:t/i}function la(t,e){for(var r=e.length,i=0;t.indexOf(e[i])<0&&++ia;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=s,e.parent=e._dp=t,e}function ya(t,e,r,i){void 0===r&&(r="_first"),void 0===i&&(i="_last");var n=e._prev,a=e._next;n?n._next=a:t[r]===e&&(t[r]=a),a?a._prev=n:t[i]===e&&(t[i]=n),e._next=e._prev=e.parent=null}function za(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0}function Aa(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t}function Ca(t,e,r,i){return t._startAt&&(L?t._startAt.revert(ht):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))}function Ea(t){return t._repeat?Tt(t._tTime,t=t.duration()+t._rDelay)*t:0}function Ga(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function Ha(t){return t._end=ja(t._start+(t._tDur/Math.abs(t._ts||t._rts||X)||0))}function Ia(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=ja(r._time-(0X)&&e.render(r,!0)),Aa(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur(n=Math.abs(n))&&(a=i,o=n);return a}function tb(t){return za(t),t.scrollTrigger&&t.scrollTrigger.kill(!!L),t.progress()<1&&At(t,"onInterrupt"),t}function wb(t){if(x()&&t){var e=(t=!t.name&&t.default||t).name,r=s(t),i=e&&!r&&t.init?function(){this._props=[]}:t,n={init:T,render:he,add:Qt,kill:ce,modifier:fe,rawVars:0},a={targetTest:0,get:0,getSetter:ne,aliases:{},register:0};if(Ft(),t!==i){if(pt[e])return;qa(i,qa(ua(t,n),a)),yt(i.prototype,yt(n,ua(t,a))),pt[i.prop=e]=i,t.targetTest&&(gt.push(i),ft[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}S(e,i),t.register&&t.register(Ee,i,_e)}else t&&Ct.push(t)}function zb(t,e,r){return(6*(t+=t<0?1:1>16,e>>8&St,e&St]:0:Et.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),Et[e])p=Et[e];else if("#"===e.charAt(0)){if(e.length<6&&(e="#"+(n=e.charAt(1))+n+(a=e.charAt(2))+a+(s=e.charAt(3))+s+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(p=parseInt(e.substr(1,6),16))>>16,p>>8&St,p&St,parseInt(e.substr(7),16)/255];p=[(e=parseInt(e.substr(1),16))>>16,e>>8&St,e&St]}else if("hsl"===e.substr(0,3))if(p=d=e.match(tt),r){if(~e.indexOf("="))return p=e.match(et),i&&p.length<4&&(p[3]=1),p}else o=+p[0]%360/360,u=p[1]/100,n=2*(h=p[2]/100)-(a=h<=.5?h*(u+1):h+u-h*u),3=U?u.endTime(!1):t._dur;return r(e)&&(isNaN(e)||e in o)?(a=e.charAt(0),s="%"===e.substr(-1),n=e.indexOf("="),"<"===a||">"===a?(0<=n&&(e=e.replace(/=/,"")),("<"===a?u._start:u.endTime(0<=u._repeat))+(parseFloat(e.substr(1))||0)*(s?(n<0?u:i).totalDuration()/100:1)):n<0?(e in o||(o[e]=h),o[e]):(a=parseFloat(e.charAt(n-1)+e.substr(n+1)),s&&i&&(a=a/100*($(i)?i[0]:i).totalDuration()),1=r&&te)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if("isPause"===i.data&&i._start=n._start)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0=this.totalDuration()||!v&&_)&&(f!==this._start&&Math.abs(l)===Math.abs(this._ts)||this._lock||(!t&&g||!(v===m&&0=i&&(a instanceof Zt?e&&n.push(a):(r&&n.push(a),t&&n.push.apply(n,a.getChildren(!0,e,r)))),a=a._next;return n},e.getById=function getById(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},e.remove=function remove(t){return r(t)?this.removeLabel(t):s(t)?this.killTweensOf(t):(ya(this,t),t===this._recent&&(this._recent=this._last),Aa(this))},e.totalTime=function totalTime(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=ja(Rt.time-(0r:!r||s.isActive())&&n.push(s):(i=s.getTweensOf(a,r)).length&&n.push.apply(n,i),s=s._next;return n},e.tweenTo=function tweenTo(t,e){e=e||{};var r,i=this,n=xt(i,t),a=e.startAt,s=e.onStart,o=e.onStartParams,u=e.immediateRender,h=Zt.to(i,qa({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale())||X,onStart:function onStart(){if(i.pause(),!r){var t=e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale());h._dur!==t&&Ra(h,t,0,1).render(h._time,!0,!0),r=1}s&&s.apply(h,o||[])}},e));return u?h.render(0):h},e.tweenFromTo=function tweenFromTo(t,e,r){return this.tweenTo(e,qa({startAt:{time:xt(this,t)}},r))},e.recent=function recent(){return this._recent},e.nextLabel=function nextLabel(t){return void 0===t&&(t=this._time),rb(this,xt(this,t))},e.previousLabel=function previousLabel(t){return void 0===t&&(t=this._time),rb(this,xt(this,t),1)},e.currentLabel=function currentLabel(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+X)},e.shiftChildren=function shiftChildren(t,e,r){void 0===r&&(r=0);for(var i,n=this._first,a=this.labels;n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in a)a[i]>=r&&(a[i]+=t);return Aa(this)},e.invalidate=function invalidate(t){var e=this._first;for(this._lock=0;e;)e.invalidate(t),e=e._next;return i.prototype.invalidate.call(this,t)},e.clear=function clear(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Aa(this)},e.totalDuration=function totalDuration(t){var e,r,i,n=0,a=this,s=a._last,o=U;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-t:t));if(a._dirty){for(i=a.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),o<(r=s._start)&&a._sort&&s._ts&&!a._lock?(a._lock=1,Ka(a,s,r-s._delay,1)._lock=0):o=r,r<0&&s._ts&&(n-=r,(!i&&!a._dp||i&&i.smoothChildTiming)&&(a._start+=r/a._ts,a._time-=r,a._tTime-=r),a.shiftChildren(-r,!1,-Infinity),o=0),s._end>n&&s._ts&&(n=s._end),s=e;Ra(a,a===I&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},Timeline.updateRoot=function updateRoot(t){if(I._ts&&(na(I,Ga(t,I)),f=Rt.frame),Rt.frame>=mt){mt+=q.autoSleep||120;var e=I._first;if((!e||!e._ts)&&q.autoSleep&&Rt._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||Rt.sleep()}}},Timeline}(Ut);qa(Xt.prototype,{_lock:0,_hasPause:0,_forcing:0});function ac(t,e,i,n,a,o){var u,h,l,f;if(pt[t]&&!1!==(u=new pt[t]).init(a,u.rawVars?e[t]:function _processVars(t,e,i,n,a){if(s(t)&&(t=Kt(t,a,e,i,n)),!v(t)||t.style&&t.nodeType||$(t)||Z(t))return r(t)?Kt(t,a,e,i,n):t;var o,u={};for(o in t)u[o]=Kt(t[o],a,e,i,n);return u}(e[t],n,a,o,i),i,n,o)&&(i._pt=h=new _e(i._pt,a,t,0,1,u.render,u,0,u.priority),i!==c))for(l=i._ptLookup[i._targets.indexOf(a)],f=u._props.length;f--;)l[u._props[f]]=h;return u}function gc(t,r,e,i){var n,a,s=r.ease||i||"power1.inOut";if($(r))a=e[t]||(e[t]=[]),r.forEach(function(t,e){return a.push({t:e/(r.length-1)*100,v:t,e:s})});else for(n in r)a=e[n]||(e[n]=[]),"ease"===n||a.push({t:parseFloat(t),v:r[n],e:s})}var Nt,Wt,Qt=function _addPropTween(t,e,i,n,a,o,u,h,l,f){s(n)&&(n=n(a||0,t,o));var c,d=t[e],p="get"!==i?i:s(d)?l?t[e.indexOf("set")||!s(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():d,_=s(d)?l?re:te:$t;if(r(n)&&(~n.indexOf("random(")&&(n=ob(n)),"="===n.charAt(1)&&(!(c=ka(p,n)+(Ya(p)||0))&&0!==c||(n=c))),!f||p!==n||Wt)return isNaN(p*n)||""===n?(d||e in t||Q(e,n),function _addComplexStringPropTween(t,e,r,i,n,a,s){var o,u,h,l,f,c,d,p,_=new _e(this._pt,t,e,0,1,ue,null,n),m=0,g=0;for(_.b=r,_.e=i,r+="",(d=~(i+="").indexOf("random("))&&(i=ob(i)),a&&(a(p=[r,i],t,e),r=p[0],i=p[1]),u=r.match(it)||[];o=it.exec(i);)l=o[0],f=i.substring(m,o.index),h?h=(h+1)%5:"rgba("===f.substr(-5)&&(h=1),l!==u[g++]&&(c=parseFloat(u[g-1])||0,_._pt={_next:_._pt,p:f||1===g?f:",",s:c,c:"="===l.charAt(1)?ka(c,l)-c:parseFloat(l)-c,m:h&&h<4?Math.round:0},m=it.lastIndex);return _.c=m")}),s.duration();else{for(l in u={},x)"ease"===l||"easeEach"===l||gc(l,x[l],u,x.easeEach);for(l in u)for(C=u[l].sort(function(t,e){return t.t-e.t}),o=D=0;o=t._tDur||e<0)&&t.ratio===u&&(u&&za(t,1),r||L||(At(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},e.targets=function targets(){return this._targets},e.invalidate=function invalidate(t){return t&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),z.prototype.invalidate.call(this,t)},e.resetTo=function resetTo(t,e,r,i){d||Rt.wake(),this._ts||this.play();var n,a=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Gt(this,a),n=this._ease(a/this._dur),function _updatePropTweens(t,e,r,i,n,a,s){var o,u,h,l,f=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!f)for(f=t._ptCache[e]=[],h=t._ptLookup,l=t._targets.length;l--;){if((o=h[l][e])&&o.d&&o.d._pt)for(o=o.d._pt;o&&o.p!==e&&o.fp!==e;)o=o._next;if(!o)return Wt=1,t.vars[e]="+=0",Gt(t,s),Wt=0,1;f.push(o)}for(l=f.length;l--;)(o=(u=f[l])._pt||u).s=!i&&0!==i||n?o.s+(i||0)+a*o.c:i,o.c=r-o.s,u.e&&(u.e=ia(r)+Ya(u.e)),u.b&&(u.b=o.s+Ya(u.b))}(this,t,e,r,i,n,a)?this.resetTo(t,e,r,i):(Ia(this,0),this.parent||xa(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function kill(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?tb(this):this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Nt&&!0!==Nt.vars.overwrite)._first||tb(this),this.parent&&i!==this.timeline.totalDuration()&&Ra(this,this._dur*this.timeline._tDur/i,0,1),this}var n,a,s,o,u,h,l,f=this._targets,c=t?Ot(t):f,d=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function _arraysMatch(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(f,c))return"all"===e&&(this._pt=0),tb(this);for(n=this._op=this._op||[],"all"!==e&&(r(e)&&(u={},ha(e,function(t){return u[t]=1}),e=u),e=function _addAliasesToVars(t,e){var r,i,n,a,s=t[0]?fa(t[0]).harness:0,o=s&&s.aliases;if(!o)return e;for(i in r=yt({},e),o)if(i in r)for(n=(a=o[i].split(",")).length;n--;)r[a[n]]=r[i];return r}(f,e)),l=f.length;l--;)if(~c.indexOf(f[l]))for(u in a=d[l],"all"===e?(n[l]=e,o=a,s={}):(s=n[l]=n[l]||{},o=e),o)(h=a&&a[u])&&("kill"in h.d&&!0!==h.d.kill(u)||ya(this,h,"_pt"),delete a[u]),"all"!==s&&(s[u]=1);return this._initted&&!this._pt&&p&&tb(this),this},Tween.to=function to(t,e,r){return new Tween(t,e,r)},Tween.from=function from(t,e){return Va(1,arguments)},Tween.delayedCall=function delayedCall(t,e,r,i){return new Tween(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},Tween.fromTo=function fromTo(t,e,r){return Va(2,arguments)},Tween.set=function set(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new Tween(t,e)},Tween.killTweensOf=function killTweensOf(t,e,r){return I.killTweensOf(t,e,r)},Tween}(Ut);qa(Zt.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ha("staggerTo,staggerFrom,staggerFromTo",function(r){Zt[r]=function(){var t=new Xt,e=Mt.call(arguments,0);return e.splice("staggerFromTo"===r?5:4,0,0),t[r].apply(t,e)}});function oc(t,e,r){return t.setAttribute(e,r)}function wc(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)}var $t=function _setterPlain(t,e,r){return t[e]=r},te=function _setterFunc(t,e,r){return t[e](r)},re=function _setterFuncWithParam(t,e,r,i){return t[e](i.fp,r)},ne=function _getSetter(t,e){return s(t[e])?te:u(t[e])&&t.setAttribute?oc:$t},ae=function _renderPlain(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},se=function _renderBoolean(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ue=function _renderComplexString(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)},he=function _renderPropTweens(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},fe=function _addPluginModifier(t,e,r,i){for(var n,a=this._pt;a;)n=a._next,a.p===i&&a.modifier(t,e,r),a=n},ce=function _killPropTweensOf(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?ya(this,i,"_pt"):i.dep||(e=1),i=r;return!e},pe=function _sortPropTweensByPriority(t){for(var e,r,i,n,a=t._pt;a;){for(e=a._next,r=i;r&&r.pr>a.pr;)r=r._next;(a._prev=r?r._prev:n)?a._prev._next=a:i=a,(a._next=r)?r._prev=a:n=a,a=e}t._pt=i},_e=(PropTween.prototype.modifier=function modifier(t,e,r){this.mSet=this.mSet||this.set,this.set=wc,this.m=t,this.mt=r,this.tween=e},PropTween);function PropTween(t,e,r,i,n,a,s,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=a||ae,this.d=s||this,this.set=o||$t,this.pr=u||0,(this._next=t)&&(t._prev=this)}ha(vt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(t){return ft[t]=1}),ot.TweenMax=ot.TweenLite=Zt,ot.TimelineLite=ot.TimelineMax=Xt,I=new Xt({sortChildren:!1,defaults:V,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),q.stringFilter=Fb;function Ec(t){return(ye[t]||Te).map(function(t){return t()})}function Fc(){var t=Date.now(),o=[];2o.scrollHeight,a.removeChild(o),O=n,Me=function(e){for(var t=e.split(","),n=(("onpointerdown"in s?"pointerdown,pointermove,pointerup,pointercancel":"onmspointerdown"in s?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":e).split(",")),o={},r=4;-1<--r;)o[t[r]]=n[r],o[n[r]]=t[r];try{ve.addEventListener("test",null,Object.defineProperty({},"passive",{get:function get(){d=1}}))}catch(e){}return o}("touchstart,touchmove,touchend,touchcancel"),za(ye,"touchcancel",aa),za(me,"touchmove",aa),l&&l.addEventListener("touchstart",aa),za(ye,"contextmenu",function(){for(var e in ze)ze[e].isPressed&&ze[e].endDrag()}),xe=be=Y()}var n,o,r,i,a;xe?(Se=xe.plugins.inertia,Le=xe.core.context||function(){},c=xe.utils.checkPrefix,R=c(R),Ne=c(Ne),Te=xe.utils.toArray,Ye=xe.core.getStyleSaver,k=!!c("perspective")):e&&console.warn("Please gsap.registerPlugin(Draggable)")}var xe,me,ye,ve,l,s,we,be,c,Te,d,De,Me,Ee,_e,Se,Xe,Pe,Le,Ye,k,O,n,Ce=0,R="transform",Ne="transformOrigin",ke=Array.isArray,Ae=180/Math.PI,Oe=1e20,a=new ge,Re=Date.now||function(){return(new Date).getTime()},Be=[],ze={},Fe=0,o=/^(?:a|input|textarea|button|select)$/i,Ie=0,He={},Qe={},We=function _isRoot(e){return!(e&&e!==ve&&9!==e.nodeType&&e!==ye.body&&e!==me&&e.nodeType&&e.parentNode)},p={},Ge={},B=function _getElementBounds(e,t){t=Te(t)[0];var n,o,r,i,a,l,s,c,d,p,u,h,f,g=e.getBBox&&e.ownerSVGElement,x=e.ownerDocument||ye;if(e===me)r=Fa(x),o=(n=Ga(x))+(x.documentElement.clientWidth||e.innerWidth||x.body.clientWidth||0),i=r+((e.innerHeight||0)-20d||l.rightp||l.bottom=l.width*l.height*n:o.width>n&&o.height>n))},Draggable);function Draggable(h,p){var e;e=Ke.call(this)||this,be||_a(1),h=Te(h)[0],e.styles=Ye&&Ye(h,"transform,left,top"),Se=Se||xe.plugins.inertia,e.vars=p=ra(p||{}),e.target=h,e.x=e.y=e.rotation=0,e.dragResistance=parseFloat(p.dragResistance)||0,e.edgeResistance=isNaN(p.edgeResistance)?1:parseFloat(p.edgeResistance)||0,e.lockAxis=p.lockAxis,e.autoScroll=p.autoScroll||0,e.lockedAxis=null,e.allowEventDefault=!!p.allowEventDefault,xe.getProperty(h,"x");function Qg(e,t){return parseFloat(se.get(h,e,t))}function xh(e){return Ba(e),e.stopImmediatePropagation&&e.stopImmediatePropagation(),!1}function yh(e){if(q.autoScroll&&q.isDragging&&(te||Y)){var t,n,o,r,i,a,l,s,c=h,d=15*q.autoScroll;for(te=!1,Qe.scrollTop=null!=me.pageYOffset?me.pageYOffset:null!=de.documentElement.scrollTop?de.documentElement.scrollTop:de.body.scrollTop,Qe.scrollLeft=null!=me.pageXOffset?me.pageXOffset:null!=de.documentElement.scrollLeft?de.documentElement.scrollLeft:de.body.scrollLeft,r=q.pointerX-Qe.scrollLeft,i=q.pointerY-Qe.scrollTop;c&&!n;)t=(n=We(c.parentNode))?Qe:c.parentNode,o=n?{bottom:Math.max(ve.clientHeight,me.innerHeight||0),right:Math.max(ve.clientWidth,me.innerWidth||0),left:0,top:0}:t.getBoundingClientRect(),a=l=0,U&&((s=t._gsMaxScrollY-t.scrollTop)<0?l=s:i>o.bottom-re&&s?(te=!0,l=Math.min(s,d*(1-Math.max(0,o.bottom-i)/re)|0)):io.right-oe&&s?(te=!0,a=Math.min(s,d*(1-Math.max(0,o.right-r)/oe)|0)):rj?(q.y=a,T+(D-a)*c):T):(A&&(s=e*A.a+t*A.c+A.e,t=e*A.b+t*A.d+A.f,e=s),(r=t-b)Math.abs(r)?"y":U?"x":null,s&&Z(q.vars.onLockAxis)&&q.vars.onLockAxis.call(q,q.pointerEvent)),"y"===s?r=0:"x"===s&&(o=0)),i=da(T+o*c),a=da(D+r*c)),(C||N||k)&&(q.x!==i||q.y!==a&&!W)&&(k&&(He.x=i,He.y=a,s=k(He),i=da(s.x),a=da(s.y)),C&&(i=da(C(i))),N&&(a=da(N(a)))),M&&(Ea._gsMaxScrollY&&(a.scrollTop=a._gsMaxScrollY),V&&a.scrollLeft>a._gsMaxScrollX&&(a.scrollLeft=a._gsMaxScrollX),i=a;q.isThrowing&&(r||q.endX>E||q.endXX||q.endY+s.max+1e-10?(v=s.unitFactor||V.unitFactors[a]||1,(p=f>s.max&&s.min!==s.max||-15p&&(k||s.preventOvershoot?l=s.min-c:g=s.min-c-l)),this._props.push(a),this.styles&&this.styles.save(a),this._pt=new M(this._pt,t,a,c,0,S,0,d.set(t,a,this)),this._pt.u=u||0,this._pt.c1=l,this._pt.c2=g);return r.duration(w),1},render:function render(t,e){var r=e._pt;if((t=k(e.tween._time/e.tween._dur))||!w())for(;r;)r.set(r.t,r.p,W(r.s+r.c1*t+r.c2*t*t)+r.u,r.d,t),r=r._next;else e.styles.revert()}};"track,untrack,isTracking,getVelocity,getByTarget".split(",").forEach(function(t){return D[t]=d[t]}),L()&&h.registerPlugin(D),e.InertiaPlugin=D,e.VelocityTracker=d,e.default=D;if(typeof(window)==="undefined"||window!==e){Object.defineProperty(e,"__esModule",{value:!0})}else{delete e.default}}); !function(e,t){e(window).on("elementor/frontend/init",(function(){let t,n=elementorModules.frontend.handlers.Base;t=n.extend({bindEvents:function(){this.run()},getDefaultSettings:function(){return{allowHTML:!0}},onElementChange:debounce((function(e){-1!==e.indexOf("marquee_")&&this.run()}),400),settings:function(e){return this.getElementSettings("marquee_"+e)},run:function(){if(elementorFrontend.isEditMode())return;const t=this.$element.data("id");this.getDefaultSettings(),this.findElement(".elementor-widget-container").get(0);if(jQuery(this.$element).hasClass("elementor-section")&&this.$element.get(0),!this.$element.find(".bdt-marquee"))return;"yes"===this.getElementSettings("advanced")&&e("body").css("overflow-x","hidden");var n=".elementor-element-"+t;const r=gsap.utils.toArray(n+" .marquee-content");let s,a="right"===this.settings("direction"),o=this.settings("speed")?this.settings("speed")/100:1,i="yes"===this.settings("clickable"),d="yes"===this.settings("pause_on_hover"),l="yes"===this.settings("draggable"),g=this.settings("spacing")?this.settings("spacing"):0;this.settings("loop");const p=this.horizontalLoop(r,{paused:!1,draggable:l,repeat:-1,speed:o,paddingRight:g,reversed:a,center:!0,reversedDirection:a,onChange:(e,t)=>{s&&s.classList.remove("active"),e.classList.add("active"),s=e}});d&&this.pauseOnHover(p,r),i&&(e(r).on("mouseleave",()=>{p.reversed()?(p.play(),p.reverse()):(p.play(),p.reversed())}),r.forEach((e,t)=>{e.addEventListener("click",()=>{p.toIndex(t,{duration:.8,ease:"power1.inOut"})})}))},pauseOnHover:function(t,n){e(n).on("mouseenter",()=>{t.pause()}),e(n).on("mouseleave",()=>{t.reversed()?(t.play(),t.reverse()):(t.play(),t.reversed())})},horizontalLoop:function(e,t,n=!1){e=gsap.utils.toArray(e);let r,s,a,o=(t=t||{}).onChange,i=gsap.timeline({repeat:t.repeat,paused:t.paused,defaults:{ease:"none"},onReverseComplete:()=>i.totalTime(i.rawTime()+100*i.duration())}),d=e.length,l=e[0].offsetLeft,g=[],p=[],u=[],c=[],f=0,m=t.center,h=100*(t.speed||1),v=!1===t.snap?e=>e:gsap.utils.snap(t.snap||1),y=0,w=!0===m?e[0].parentNode:gsap.utils.toArray(m)[0]||e[0].parentNode,b=()=>{let n,s=w.getBoundingClientRect();e.forEach((e,t)=>{p[t]=parseFloat(gsap.getProperty(e,"width","px")),c[t]=v(parseFloat(gsap.getProperty(e,"x","px"))/p[t]*100+gsap.getProperty(e,"xPercent")),n=e.getBoundingClientRect(),u[t]=n.left-(t?s.right:s.left),s=n}),gsap.set(e,{xPercent:e=>c[e]}),r=e[d-1].offsetLeft+c[d-1]/100*p[d-1]-l+u[0]+e[d-1].offsetWidth*gsap.getProperty(e[d-1],"scaleX")+(parseFloat(t.paddingRight)||0)},x=()=>{y=m?i.duration()*(w.offsetWidth/2)/r:0,m&&g.forEach((e,t)=>{g[t]=s(i.labels["label"+t]+i.duration()*p[t]/2/r-y)})},P=(e,t,n)=>{let r,s=e.length,a=1e10,o=0;for(;s--;)r=Math.abs(e[s]-t),r>n/2&&(r=n-r),r{let t,n,a,o,f;for(i.clear(),t=0;t{let t=i.progress();i.progress(0,!0),b(),e&&E(),x(),e&&i.draggable?i.time(g[f],!0):i.progress(t,!0)};function C(e,t){t=t||{},n&&(e=d-e),Math.abs(e-f)>d/2&&(e+=e>f?-d:d);let r=gsap.utils.wrap(0,d,e),o=g[r];return o>i.time()!=e>f&&(o+=i.duration()*(e>f?1:-1)),(o<0||o>i.duration())&&(t.modifiers={time:s}),f=r,t.overwrite=!0,gsap.killTweensOf(a),i.tweenTo(o,t)}if(gsap.set(e,{x:0}),b(),E(),x(),window.addEventListener("resize",()=>L(!0)),i.next=e=>C(f+1,e),i.previous=e=>C(f-1,e),i.current=()=>f,i.toIndex=(e,t)=>C(e,t),i.closestIndex=e=>{let t=P(g,i.time(),i.duration());return e&&(f=t),t},i.times=g,i.progress(1,!0).progress(0,!0),t.reversed&&(i.vars.onReverseComplete(),i.reverse()),t.draggable&&"function"==typeof Draggable){a=document.createElement("div");let t,n,o,d=gsap.utils.wrap(0,1),l=()=>i.progress(d(n+(o.startX-o.x)*t)),p=()=>i.closestIndex(!0);"undefined"==typeof InertiaPlugin&&console.warn("InertiaPlugin required for momentum-based scrolling and snapping. https://greensock.com/club"),o=Draggable.create(a,{trigger:e[0].parentNode,type:"x",onPressInit(){gsap.killTweensOf(i),n=i.progress(),L(),t=1/r,gsap.set(a,{x:n/-t})},onDrag:l,onThrowUpdate:l,inertia:!0,snap:e=>{let n=-e*t*i.duration(),r=s(n),a=g[P(g,r,i.duration())]-r;return Math.abs(a)>i.duration()/2&&(a+=a<0?i.duration():-i.duration()),(n+a)/i.duration()/-t},onRelease:p,onThrowComplete:p})[0],i.draggable=o}return i.closestIndex(!0),o&&o(e[f],f),i}}),elementorFrontend.hooks.addAction("frontend/element_ready/bdt-marquee.default",(function(e){elementorFrontend.elementsHandler.addHandler(t,{$element:e})}))}))}(jQuery,window.elementorFrontend); !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Swiper=t()}(this,(function(){"use strict";function e(e){return null!==e&&"object"==typeof e&&"constructor"in e&&e.constructor===Object}function t(i,s){void 0===i&&(i={}),void 0===s&&(s={}),Object.keys(s).forEach((function(a){void 0===i[a]?i[a]=s[a]:e(s[a])&&e(i[a])&&Object.keys(s[a]).length>0&&t(i[a],s[a])}))}var i="undefined"!=typeof document?document:{},s={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};t(i,s);var a="undefined"!=typeof window?window:{};t(a,{document:s,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}}});var r=function(e){for(var t=0;t=0&&d.indexOf(">")>=0){var h="div";for(0===d.indexOf(":~]/)?(t||i).querySelectorAll(e.trim()):[i.getElementById(e.trim().split("#")[1])],n=0;n0&&e[0].nodeType)for(n=0;n=0;u-=1){var v=c[u];r&&v.listener===r||r&&v.listener&&v.listener.dom7proxy&&v.listener.dom7proxy===r?(p.removeEventListener(d,v.proxyListener,n),c.splice(u,1)):r||(p.removeEventListener(d,v.proxyListener,n),c.splice(u,1))}}return this},trigger:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var s=e[0].split(" "),r=e[1],n=0;n0})),d.dispatchEvent(h),d.dom7EventData=[],delete d.dom7EventData}return this},transitionEnd:function(e){var t,i=["webkitTransitionEnd","transitionend"],s=this;function a(r){if(r.target===this)for(e.call(this,r),t=0;t0){if(e){var t=this.styles();return this[0].offsetWidth+parseFloat(t.getPropertyValue("margin-right"))+parseFloat(t.getPropertyValue("margin-left"))}return this[0].offsetWidth}return null},outerHeight:function(e){if(this.length>0){if(e){var t=this.styles();return this[0].offsetHeight+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))}return this[0].offsetHeight}return null},offset:function(){if(this.length>0){var e=this[0],t=e.getBoundingClientRect(),s=i.body,r=e.clientTop||s.clientTop||0,n=e.clientLeft||s.clientLeft||0,o=e===a?a.scrollY:e.scrollTop,l=e===a?a.scrollX:e.scrollLeft;return{top:t.top+o-r,left:t.left+l-n}}return null},css:function(e,t){var i;if(1===arguments.length){if("string"!=typeof e){for(i=0;ii-1?[]:e<0?(t=i+e)<0?[]:[this[t]]:[this[e]])},append:function(){for(var e,t=[],s=arguments.length;s--;)t[s]=arguments[s];for(var a=0;a=0;s-=1)this[t].insertBefore(a.childNodes[s],this[t].childNodes[0])}else if(e instanceof r)for(s=0;s0?e?this[0].nextElementSibling&&n(this[0].nextElementSibling).is(e)?new r([this[0].nextElementSibling]):new r([]):this[0].nextElementSibling?new r([this[0].nextElementSibling]):new r([]):new r([])},nextAll:function(e){var t=[],i=this[0];if(!i)return new r([]);for(;i.nextElementSibling;){var s=i.nextElementSibling;e?n(s).is(e)&&t.push(s):t.push(s),i=s}return new r(t)},prev:function(e){if(this.length>0){var t=this[0];return e?t.previousElementSibling&&n(t.previousElementSibling).is(e)?new r([t.previousElementSibling]):new r([]):t.previousElementSibling?new r([t.previousElementSibling]):new r([])}return new r([])},prevAll:function(e){var t=[],i=this[0];if(!i)return new r([]);for(;i.previousElementSibling;){var s=i.previousElementSibling;e?n(s).is(e)&&t.push(s):t.push(s),i=s}return new r(t)},parent:function(e){for(var t=[],i=0;i6&&(s=s.split(", ").map((function(e){return e.replace(",",".")})).join(", ")),r=new a.WebKitCSSMatrix("none"===s?"":s)):i=(r=n.MozTransform||n.OTransform||n.MsTransform||n.msTransform||n.transform||n.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===t&&(s=a.WebKitCSSMatrix?r.m41:16===i.length?parseFloat(i[12]):parseFloat(i[4])),"y"===t&&(s=a.WebKitCSSMatrix?r.m42:16===i.length?parseFloat(i[13]):parseFloat(i[5])),s||0},parseUrlQuery:function(e){var t,i,s,r,n={},o=e||a.location.href;if("string"==typeof o&&o.length)for(r=(i=(o=o.indexOf("?")>-1?o.replace(/\S*\?/,""):"").split("&").filter((function(e){return""!==e}))).length,t=0;t=0,observer:"MutationObserver"in a||"WebkitMutationObserver"in a,passiveListener:function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});a.addEventListener("testPassiveListener",null,t)}catch(e){}return e}(),gestures:"ongesturestart"in a},p=function(e){void 0===e&&(e={});var t=this;t.params=e,t.eventsListeners={},t.params&&t.params.on&&Object.keys(t.params.on).forEach((function(e){t.on(e,t.params.on[e])}))},c={components:{configurable:!0}};p.prototype.on=function(e,t,i){var s=this;if("function"!=typeof t)return s;var a=i?"unshift":"push";return e.split(" ").forEach((function(e){s.eventsListeners[e]||(s.eventsListeners[e]=[]),s.eventsListeners[e][a](t)})),s},p.prototype.once=function(e,t,i){var s=this;if("function"!=typeof t)return s;function a(){for(var i=[],r=arguments.length;r--;)i[r]=arguments[r];s.off(e,a),a.f7proxy&&delete a.f7proxy,t.apply(s,i)}return a.f7proxy=t,s.on(e,a,i)},p.prototype.off=function(e,t){var i=this;return i.eventsListeners?(e.split(" ").forEach((function(e){void 0===t?i.eventsListeners[e]=[]:i.eventsListeners[e]&&i.eventsListeners[e].length&&i.eventsListeners[e].forEach((function(s,a){(s===t||s.f7proxy&&s.f7proxy===t)&&i.eventsListeners[e].splice(a,1)}))})),i):i},p.prototype.emit=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var i,s,a,r=this;if(!r.eventsListeners)return r;"string"==typeof e[0]||Array.isArray(e[0])?(i=e[0],s=e.slice(1,e.length),a=r):(i=e[0].events,s=e[0].data,a=e[0].context||r);var n=Array.isArray(i)?i:i.split(" ");return n.forEach((function(e){if(r.eventsListeners&&r.eventsListeners[e]){var t=[];r.eventsListeners[e].forEach((function(e){t.push(e)})),t.forEach((function(e){e.apply(a,s)}))}})),r},p.prototype.useModulesParams=function(e){var t=this;t.modules&&Object.keys(t.modules).forEach((function(i){var s=t.modules[i];s.params&&d.extend(e,s.params)}))},p.prototype.useModules=function(e){void 0===e&&(e={});var t=this;t.modules&&Object.keys(t.modules).forEach((function(i){var s=t.modules[i],a=e[i]||{};s.instance&&Object.keys(s.instance).forEach((function(e){var i=s.instance[e];t[e]="function"==typeof i?i.bind(t):i})),s.on&&t.on&&Object.keys(s.on).forEach((function(e){t.on(e,s.on[e])})),s.create&&s.create.bind(t)(a)}))},c.components.set=function(e){this.use&&this.use(e)},p.installModule=function(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];var s=this;s.prototype.modules||(s.prototype.modules={});var a=e.name||Object.keys(s.prototype.modules).length+"_"+d.now();return s.prototype.modules[a]=e,e.proto&&Object.keys(e.proto).forEach((function(t){s.prototype[t]=e.proto[t]})),e.static&&Object.keys(e.static).forEach((function(t){s[t]=e.static[t]})),e.install&&e.install.apply(s,t),s},p.use=function(e){for(var t=[],i=arguments.length-1;i-- >0;)t[i]=arguments[i+1];var s=this;return Array.isArray(e)?(e.forEach((function(e){return s.installModule(e)})),s):s.installModule.apply(s,[e].concat(t))},Object.defineProperties(p,c);var u={updateSize:function(){var e,t,i=this.$el;e=void 0!==this.params.width?this.params.width:i[0].clientWidth,t=void 0!==this.params.height?this.params.height:i[0].clientHeight,0===e&&this.isHorizontal()||0===t&&this.isVertical()||(e=e-parseInt(i.css("padding-left"),10)-parseInt(i.css("padding-right"),10),t=t-parseInt(i.css("padding-top"),10)-parseInt(i.css("padding-bottom"),10),d.extend(this,{width:e,height:t,size:this.isHorizontal()?e:t}))},updateSlides:function(){var e=this.params,t=this.$wrapperEl,i=this.size,s=this.rtlTranslate,r=this.wrongRTL,n=this.virtual&&e.virtual.enabled,o=n?this.virtual.slides.length:this.slides.length,l=t.children("."+this.params.slideClass),h=n?this.virtual.slides.length:l.length,p=[],c=[],u=[];function v(t){return!e.cssMode||t!==l.length-1}var f=e.slidesOffsetBefore;"function"==typeof f&&(f=e.slidesOffsetBefore.call(this));var m=e.slidesOffsetAfter;"function"==typeof m&&(m=e.slidesOffsetAfter.call(this));var g=this.snapGrid.length,b=this.snapGrid.length,w=e.spaceBetween,y=-f,x=0,E=0;if(void 0!==i){var T,S;"string"==typeof w&&w.indexOf("%")>=0&&(w=parseFloat(w.replace("%",""))/100*i),this.virtualSize=-w,s?l.css({marginLeft:"",marginTop:""}):l.css({marginRight:"",marginBottom:""}),e.slidesPerColumn>1&&(T=Math.floor(h/e.slidesPerColumn)===h/this.params.slidesPerColumn?h:Math.ceil(h/e.slidesPerColumn)*e.slidesPerColumn,"auto"!==e.slidesPerView&&"row"===e.slidesPerColumnFill&&(T=Math.max(T,e.slidesPerView*e.slidesPerColumn)));for(var C,M=e.slidesPerColumn,P=T/M,z=Math.floor(h/e.slidesPerColumn),k=0;k1){var L=void 0,I=void 0,D=void 0;if("row"===e.slidesPerColumnFill&&e.slidesPerGroup>1){var O=Math.floor(k/(e.slidesPerGroup*e.slidesPerColumn)),A=k-e.slidesPerColumn*e.slidesPerGroup*O,G=0===O?e.slidesPerGroup:Math.min(Math.ceil((h-O*M*e.slidesPerGroup)/M),e.slidesPerGroup);L=(I=A-(D=Math.floor(A/G))*G+O*e.slidesPerGroup)+D*T/M,$.css({"-webkit-box-ordinal-group":L,"-moz-box-ordinal-group":L,"-ms-flex-order":L,"-webkit-order":L,order:L})}else"column"===e.slidesPerColumnFill?(D=k-(I=Math.floor(k/M))*M,(I>z||I===z&&D===M-1)&&(D+=1)>=M&&(D=0,I+=1)):I=k-(D=Math.floor(k/P))*P;$.css("margin-"+(this.isHorizontal()?"top":"left"),0!==D&&e.spaceBetween&&e.spaceBetween+"px")}if("none"!==$.css("display")){if("auto"===e.slidesPerView){var H=a.getComputedStyle($[0],null),B=$[0].style.transform,N=$[0].style.webkitTransform;if(B&&($[0].style.transform="none"),N&&($[0].style.webkitTransform="none"),e.roundLengths)S=this.isHorizontal()?$.outerWidth(!0):$.outerHeight(!0);else if(this.isHorizontal()){var X=parseFloat(H.getPropertyValue("width")),V=parseFloat(H.getPropertyValue("padding-left")),Y=parseFloat(H.getPropertyValue("padding-right")),F=parseFloat(H.getPropertyValue("margin-left")),W=parseFloat(H.getPropertyValue("margin-right")),R=H.getPropertyValue("box-sizing");S=R&&"border-box"===R?X+F+W:X+V+Y+F+W}else{var q=parseFloat(H.getPropertyValue("height")),j=parseFloat(H.getPropertyValue("padding-top")),K=parseFloat(H.getPropertyValue("padding-bottom")),U=parseFloat(H.getPropertyValue("margin-top")),_=parseFloat(H.getPropertyValue("margin-bottom")),Z=H.getPropertyValue("box-sizing");S=Z&&"border-box"===Z?q+U+_:q+j+K+U+_}B&&($[0].style.transform=B),N&&($[0].style.webkitTransform=N),e.roundLengths&&(S=Math.floor(S))}else S=(i-(e.slidesPerView-1)*w)/e.slidesPerView,e.roundLengths&&(S=Math.floor(S)),l[k]&&(this.isHorizontal()?l[k].style.width=S+"px":l[k].style.height=S+"px");l[k]&&(l[k].swiperSlideSize=S),u.push(S),e.centeredSlides?(y=y+S/2+x/2+w,0===x&&0!==k&&(y=y-i/2-w),0===k&&(y=y-i/2-w),Math.abs(y)<.001&&(y=0),e.roundLengths&&(y=Math.floor(y)),E%e.slidesPerGroup==0&&p.push(y),c.push(y)):(e.roundLengths&&(y=Math.floor(y)),(E-Math.min(this.params.slidesPerGroupSkip,E))%this.params.slidesPerGroup==0&&p.push(y),c.push(y),y=y+S+w),this.virtualSize+=S+w,x=S,E+=1}}if(this.virtualSize=Math.max(this.virtualSize,i)+m,s&&r&&("slide"===e.effect||"coverflow"===e.effect)&&t.css({width:this.virtualSize+e.spaceBetween+"px"}),e.setWrapperSize&&(this.isHorizontal()?t.css({width:this.virtualSize+e.spaceBetween+"px"}):t.css({height:this.virtualSize+e.spaceBetween+"px"})),e.slidesPerColumn>1&&(this.virtualSize=(S+e.spaceBetween)*T,this.virtualSize=Math.ceil(this.virtualSize/e.slidesPerColumn)-e.spaceBetween,this.isHorizontal()?t.css({width:this.virtualSize+e.spaceBetween+"px"}):t.css({height:this.virtualSize+e.spaceBetween+"px"}),e.centeredSlides)){C=[];for(var Q=0;Q1&&p.push(this.virtualSize-i)}if(0===p.length&&(p=[0]),0!==e.spaceBetween&&(this.isHorizontal()?s?l.filter(v).css({marginLeft:w+"px"}):l.filter(v).css({marginRight:w+"px"}):l.filter(v).css({marginBottom:w+"px"})),e.centeredSlides&&e.centeredSlidesBounds){var ie=0;u.forEach((function(t){ie+=t+(e.spaceBetween?e.spaceBetween:0)}));var se=(ie-=e.spaceBetween)-i;p=p.map((function(e){return e<0?-f:e>se?se+m:e}))}if(e.centerInsufficientSlides){var ae=0;if(u.forEach((function(t){ae+=t+(e.spaceBetween?e.spaceBetween:0)})),(ae-=e.spaceBetween)1)if(this.params.centeredSlides)this.visibleSlides.each((function(e,t){i.push(t)}));else for(t=0;tthis.slides.length)break;i.push(this.slides.eq(a)[0])}else i.push(this.slides.eq(this.activeIndex)[0]);for(t=0;ts?r:s}s&&this.$wrapperEl.css("height",s+"px")},updateSlidesOffset:function(){for(var e=this.slides,t=0;t=0&&d1&&h<=this.size||d<=0&&h>=this.size)&&(this.visibleSlides.push(o),this.visibleSlidesIndexes.push(r),i.eq(r).addClass(t.slideVisibleClass))}o.progress=s?-l:l}this.visibleSlides=n(this.visibleSlides)}},updateProgress:function(e){if(void 0===e){var t=this.rtlTranslate?-1:1;e=this&&this.translate&&this.translate*t||0}var i=this.params,s=this.maxTranslate()-this.minTranslate(),a=this.progress,r=this.isBeginning,n=this.isEnd,o=r,l=n;0===s?(a=0,r=!0,n=!0):(r=(a=(e-this.minTranslate())/s)<=0,n=a>=1),d.extend(this,{progress:a,isBeginning:r,isEnd:n}),(i.watchSlidesProgress||i.watchSlidesVisibility||i.centeredSlides&&i.autoHeight)&&this.updateSlidesProgress(e),r&&!o&&this.emit("reachBeginning toEdge"),n&&!l&&this.emit("reachEnd toEdge"),(o&&!r||l&&!n)&&this.emit("fromEdge"),this.emit("progress",a)},updateSlidesClasses:function(){var e,t=this.slides,i=this.params,s=this.$wrapperEl,a=this.activeIndex,r=this.realIndex,n=this.virtual&&i.virtual.enabled;t.removeClass(i.slideActiveClass+" "+i.slideNextClass+" "+i.slidePrevClass+" "+i.slideDuplicateActiveClass+" "+i.slideDuplicateNextClass+" "+i.slideDuplicatePrevClass),(e=n?this.$wrapperEl.find("."+i.slideClass+'[data-swiper-slide-index="'+a+'"]'):t.eq(a)).addClass(i.slideActiveClass),i.loop&&(e.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+r+'"]').addClass(i.slideDuplicateActiveClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+r+'"]').addClass(i.slideDuplicateActiveClass));var o=e.nextAll("."+i.slideClass).eq(0).addClass(i.slideNextClass);i.loop&&0===o.length&&(o=t.eq(0)).addClass(i.slideNextClass);var l=e.prevAll("."+i.slideClass).eq(0).addClass(i.slidePrevClass);i.loop&&0===l.length&&(l=t.eq(-1)).addClass(i.slidePrevClass),i.loop&&(o.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+o.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+o.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicateNextClass),l.hasClass(i.slideDuplicateClass)?s.children("."+i.slideClass+":not(."+i.slideDuplicateClass+')[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass):s.children("."+i.slideClass+"."+i.slideDuplicateClass+'[data-swiper-slide-index="'+l.attr("data-swiper-slide-index")+'"]').addClass(i.slideDuplicatePrevClass))},updateActiveIndex:function(e){var t,i=this.rtlTranslate?this.translate:-this.translate,s=this.slidesGrid,a=this.snapGrid,r=this.params,n=this.activeIndex,o=this.realIndex,l=this.snapIndex,h=e;if(void 0===h){for(var p=0;p=s[p]&&i=s[p]&&i=s[p]&&(h=p);r.normalizeSlideIndex&&(h<0||void 0===h)&&(h=0)}if(a.indexOf(i)>=0)t=a.indexOf(i);else{var c=Math.min(r.slidesPerGroupSkip,h);t=c+Math.floor((h-c)/r.slidesPerGroup)}if(t>=a.length&&(t=a.length-1),h!==n){var u=parseInt(this.slides.eq(h).attr("data-swiper-slide-index")||h,10);d.extend(this,{snapIndex:t,realIndex:u,previousIndex:n,activeIndex:h}),this.emit("activeIndexChange"),this.emit("snapIndexChange"),o!==u&&this.emit("realIndexChange"),(this.initialized||this.params.runCallbacksOnInit)&&this.emit("slideChange")}else t!==l&&(this.snapIndex=t,this.emit("snapIndexChange"))},updateClickedSlide:function(e){var t=this.params,i=n(e.target).closest("."+t.slideClass)[0],s=!1;if(i)for(var a=0;ah?h:s&&ea?"next":is?"next":i=l.length&&(f=l.length-1),(p||o.initialSlide||0)===(h||0)&&i&&r.emit("beforeSlideChangeStart");var m,g=-l[f];if(r.updateProgress(g),o.normalizeSlideIndex)for(var b=0;b=Math.floor(100*d[b])&&(n=b);if(r.initialized&&n!==p){if(!r.allowSlideNext&&gr.translate&&g>r.maxTranslate()&&(p||0)!==n)return!1}if(m=n>p?"next":n=e&&(c=e)})),void 0!==c&&(d=n.indexOf(c))<0&&(d=this.activeIndex-1),this.slideTo(d,e,t,i)},slideReset:function(e,t,i){return void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),this.slideTo(this.activeIndex,e,t,i)},slideToClosest:function(e,t,i,s){void 0===e&&(e=this.params.speed),void 0===t&&(t=!0),void 0===s&&(s=.5);var a=this.activeIndex,r=Math.min(this.params.slidesPerGroupSkip,a),n=r+Math.floor((a-r)/this.params.slidesPerGroup),o=this.rtlTranslate?this.translate:-this.translate;if(o>=this.snapGrid[n]){var l=this.snapGrid[n];o-l>(this.snapGrid[n+1]-l)*s&&(a+=this.params.slidesPerGroup)}else{var d=this.snapGrid[n-1];o-d<=(this.snapGrid[n]-d)*s&&(a-=this.params.slidesPerGroup)}return a=Math.max(a,0),a=Math.min(a,this.slidesGrid.length-1),this.slideTo(a,e,t,i)},slideToClickedSlide:function(){var e,t=this,i=t.params,s=t.$wrapperEl,a="auto"===i.slidesPerView?t.slidesPerViewDynamic():i.slidesPerView,r=t.clickedIndex;if(i.loop){if(t.animating)return;e=parseInt(n(t.clickedSlide).attr("data-swiper-slide-index"),10),i.centeredSlides?rt.slides.length-t.loopedSlides+a/2?(t.loopFix(),r=s.children("."+i.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+i.slideDuplicateClass+")").eq(0).index(),d.nextTick((function(){t.slideTo(r)}))):t.slideTo(r):r>t.slides.length-a?(t.loopFix(),r=s.children("."+i.slideClass+'[data-swiper-slide-index="'+e+'"]:not(.'+i.slideDuplicateClass+")").eq(0).index(),d.nextTick((function(){t.slideTo(r)}))):t.slideTo(r)}else t.slideTo(r)}};var g={loopCreate:function(){var e=this,t=e.params,s=e.$wrapperEl;s.children("."+t.slideClass+"."+t.slideDuplicateClass).remove();var a=s.children("."+t.slideClass);if(t.loopFillGroupWithBlank){var r=t.slidesPerGroup-a.length%t.slidesPerGroup;if(r!==t.slidesPerGroup){for(var o=0;oa.length&&(e.loopedSlides=a.length);var d=[],h=[];a.each((function(t,i){var s=n(i);t=a.length-e.loopedSlides&&d.push(i),s.attr("data-swiper-slide-index",t)}));for(var p=0;p=0;c-=1)s.prepend(n(d[c].cloneNode(!0)).addClass(t.slideDuplicateClass))},loopFix:function(){this.emit("beforeLoopFix");var e,t=this.activeIndex,i=this.slides,s=this.loopedSlides,a=this.allowSlidePrev,r=this.allowSlideNext,n=this.snapGrid,o=this.rtlTranslate;this.allowSlidePrev=!0,this.allowSlideNext=!0;var l=-n[t]-this.getTranslate();if(t=i.length-s){e=-i.length+t+s,e+=s,this.slideTo(e,0,!1,!0)&&0!==l&&this.setTranslate((o?-this.translate:this.translate)-l)}this.allowSlidePrev=a,this.allowSlideNext=r,this.emit("loopFix")},loopDestroy:function(){var e=this.$wrapperEl,t=this.params,i=this.slides;e.children("."+t.slideClass+"."+t.slideDuplicateClass+",."+t.slideClass+"."+t.slideBlankClass).remove(),i.removeAttr("data-swiper-slide-index")}};var b={setGrabCursor:function(e){if(!(h.touch||!this.params.simulateTouch||this.params.watchOverflow&&this.isLocked||this.params.cssMode)){var t=this.el;t.style.cursor="move",t.style.cursor=e?"-webkit-grabbing":"-webkit-grab",t.style.cursor=e?"-moz-grabbin":"-moz-grab",t.style.cursor=e?"grabbing":"grab"}},unsetGrabCursor:function(){h.touch||this.params.watchOverflow&&this.isLocked||this.params.cssMode||(this.el.style.cursor="")}};var w,y,x,E,T,S,C,M,P,z,k,$,L,I,D,O={appendSlide:function(e){var t=this.$wrapperEl,i=this.params;if(i.loop&&this.loopDestroy(),"object"==typeof e&&"length"in e)for(var s=0;s=r)this.appendSlide(t);else{for(var n=a>e?a+1:a,o=[],l=r-1;l>=e;l-=1){var d=this.slides.eq(l);d.remove(),o.unshift(d)}if("object"==typeof t&&"length"in t){for(var p=0;pe?a+t.length:a}else i.append(t);for(var c=0;c=0||y.indexOf("Trident/")>=0,k=y.indexOf("Edge/")>=0,$=y.indexOf("Gecko/")>=0&&y.indexOf("Firefox/")>=0,L="Win32"===w,I=y.toLowerCase().indexOf("electron")>=0,D="MacIntel"===w,!C&&D&&h.touch&&(1024===E&&1366===T||834===E&&1194===T||834===E&&1112===T||768===E&&1024===T)&&(C=y.match(/(Version)\/([\d.]+)/),D=!1),x.ie=z,x.edge=k,x.firefox=$,S&&!L&&(x.os="android",x.osVersion=S[2],x.android=!0,x.androidChrome=y.toLowerCase().indexOf("chrome")>=0),(C||P||M)&&(x.os="ios",x.ios=!0),P&&!M&&(x.osVersion=P[2].replace(/_/g,"."),x.iphone=!0),C&&(x.osVersion=C[2].replace(/_/g,"."),x.ipad=!0),M&&(x.osVersion=M[3]?M[3].replace(/_/g,"."):null,x.ipod=!0),x.ios&&x.osVersion&&y.indexOf("Version/")>=0&&"10"===x.osVersion.split(".")[0]&&(x.osVersion=y.toLowerCase().split("version/")[1].split(" ")[0]),x.webView=!(!(P||C||M)||!y.match(/.*AppleWebKit(?!.*Safari)/i)&&!a.navigator.standalone)||a.matchMedia&&a.matchMedia("(display-mode: standalone)").matches,x.webview=x.webView,x.standalone=x.webView,x.desktop=!(x.ios||x.android)||I,x.desktop&&(x.electron=I,x.macos=D,x.windows=L,x.macos&&(x.os="macos"),x.windows&&(x.os="windows")),x.pixelRatio=a.devicePixelRatio||1,x);function G(e){var t=this.touchEventsData,s=this.params,r=this.touches;if(!this.animating||!s.preventInteractionOnTransition){var o=e;o.originalEvent&&(o=o.originalEvent);var l=n(o.target);if(("wrapper"!==s.touchEventsTarget||l.closest(this.wrapperEl).length)&&(t.isTouchEvent="touchstart"===o.type,(t.isTouchEvent||!("which"in o)||3!==o.which)&&!(!t.isTouchEvent&&"button"in o&&o.button>0||t.isTouched&&t.isMoved)))if(s.noSwiping&&l.closest(s.noSwipingSelector?s.noSwipingSelector:"."+s.noSwipingClass)[0])this.allowClick=!0;else if(!s.swipeHandler||l.closest(s.swipeHandler)[0]){r.currentX="touchstart"===o.type?o.targetTouches[0].pageX:o.pageX,r.currentY="touchstart"===o.type?o.targetTouches[0].pageY:o.pageY;var h=r.currentX,p=r.currentY,c=s.edgeSwipeDetection||s.iOSEdgeSwipeDetection,u=s.edgeSwipeThreshold||s.iOSEdgeSwipeThreshold;if(!c||!(h<=u||h>=a.screen.width-u)){if(d.extend(t,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),r.startX=h,r.startY=p,t.touchStartTime=d.now(),this.allowClick=!0,this.updateSize(),this.swipeDirection=void 0,s.threshold>0&&(t.allowThresholdMove=!1),"touchstart"!==o.type){var v=!0;l.is(t.formElements)&&(v=!1),i.activeElement&&n(i.activeElement).is(t.formElements)&&i.activeElement!==l[0]&&i.activeElement.blur();var f=v&&this.allowTouchMove&&s.touchStartPreventDefault;(s.touchStartForcePreventDefault||f)&&o.preventDefault()}this.emit("touchStart",o)}}}}function H(e){var t=this.touchEventsData,s=this.params,a=this.touches,r=this.rtlTranslate,o=e;if(o.originalEvent&&(o=o.originalEvent),t.isTouched){if(!t.isTouchEvent||"touchmove"===o.type){var l="touchmove"===o.type&&o.targetTouches&&(o.targetTouches[0]||o.changedTouches[0]),h="touchmove"===o.type?l.pageX:o.pageX,p="touchmove"===o.type?l.pageY:o.pageY;if(o.preventedByNestedSwiper)return a.startX=h,void(a.startY=p);if(!this.allowTouchMove)return this.allowClick=!1,void(t.isTouched&&(d.extend(a,{startX:h,startY:p,currentX:h,currentY:p}),t.touchStartTime=d.now()));if(t.isTouchEvent&&s.touchReleaseOnEdges&&!s.loop)if(this.isVertical()){if(pa.startY&&this.translate>=this.minTranslate())return t.isTouched=!1,void(t.isMoved=!1)}else if(ha.startX&&this.translate>=this.minTranslate())return;if(t.isTouchEvent&&i.activeElement&&o.target===i.activeElement&&n(o.target).is(t.formElements))return t.isMoved=!0,void(this.allowClick=!1);if(t.allowTouchCallbacks&&this.emit("touchMove",o),!(o.targetTouches&&o.targetTouches.length>1)){a.currentX=h,a.currentY=p;var c=a.currentX-a.startX,u=a.currentY-a.startY;if(!(this.params.threshold&&Math.sqrt(Math.pow(c,2)+Math.pow(u,2))=25&&(v=180*Math.atan2(Math.abs(u),Math.abs(c))/Math.PI,t.isScrolling=this.isHorizontal()?v>s.touchAngle:90-v>s.touchAngle);if(t.isScrolling&&this.emit("touchMoveOpposite",o),void 0===t.startMoving&&(a.currentX===a.startX&&a.currentY===a.startY||(t.startMoving=!0)),t.isScrolling)t.isTouched=!1;else if(t.startMoving){this.allowClick=!1,!s.cssMode&&o.cancelable&&o.preventDefault(),s.touchMoveStopPropagation&&!s.nested&&o.stopPropagation(),t.isMoved||(s.loop&&this.loopFix(),t.startTranslate=this.getTranslate(),this.setTransition(0),this.animating&&this.$wrapperEl.trigger("webkitTransitionEnd transitionend"),t.allowMomentumBounce=!1,!s.grabCursor||!0!==this.allowSlideNext&&!0!==this.allowSlidePrev||this.setGrabCursor(!0),this.emit("sliderFirstMove",o)),this.emit("sliderMove",o),t.isMoved=!0;var f=this.isHorizontal()?c:u;a.diff=f,f*=s.touchRatio,r&&(f=-f),this.swipeDirection=f>0?"prev":"next",t.currentTranslate=f+t.startTranslate;var m=!0,g=s.resistanceRatio;if(s.touchReleaseOnEdges&&(g=0),f>0&&t.currentTranslate>this.minTranslate()?(m=!1,s.resistance&&(t.currentTranslate=this.minTranslate()-1+Math.pow(-this.minTranslate()+t.startTranslate+f,g))):f<0&&t.currentTranslatet.startTranslate&&(t.currentTranslate=t.startTranslate),s.threshold>0){if(!(Math.abs(f)>s.threshold||t.allowThresholdMove))return void(t.currentTranslate=t.startTranslate);if(!t.allowThresholdMove)return t.allowThresholdMove=!0,a.startX=a.currentX,a.startY=a.currentY,t.currentTranslate=t.startTranslate,void(a.diff=this.isHorizontal()?a.currentX-a.startX:a.currentY-a.startY)}s.followFinger&&!s.cssMode&&((s.freeMode||s.watchSlidesProgress||s.watchSlidesVisibility)&&(this.updateActiveIndex(),this.updateSlidesClasses()),s.freeMode&&(0===t.velocities.length&&t.velocities.push({position:a[this.isHorizontal()?"startX":"startY"],time:t.touchStartTime}),t.velocities.push({position:a[this.isHorizontal()?"currentX":"currentY"],time:d.now()})),this.updateProgress(t.currentTranslate),this.setTranslate(t.currentTranslate))}}}}}else t.startMoving&&t.isScrolling&&this.emit("touchMoveOpposite",o)}function B(e){var t=this,i=t.touchEventsData,s=t.params,a=t.touches,r=t.rtlTranslate,n=t.$wrapperEl,o=t.slidesGrid,l=t.snapGrid,h=e;if(h.originalEvent&&(h=h.originalEvent),i.allowTouchCallbacks&&t.emit("touchEnd",h),i.allowTouchCallbacks=!1,!i.isTouched)return i.isMoved&&s.grabCursor&&t.setGrabCursor(!1),i.isMoved=!1,void(i.startMoving=!1);s.grabCursor&&i.isMoved&&i.isTouched&&(!0===t.allowSlideNext||!0===t.allowSlidePrev)&&t.setGrabCursor(!1);var p,c=d.now(),u=c-i.touchStartTime;if(t.allowClick&&(t.updateClickedSlide(h),t.emit("tap click",h),u<300&&c-i.lastClickTime<300&&t.emit("doubleTap doubleClick",h)),i.lastClickTime=d.now(),d.nextTick((function(){t.destroyed||(t.allowClick=!0)})),!i.isTouched||!i.isMoved||!t.swipeDirection||0===a.diff||i.currentTranslate===i.startTranslate)return i.isTouched=!1,i.isMoved=!1,void(i.startMoving=!1);if(i.isTouched=!1,i.isMoved=!1,i.startMoving=!1,p=s.followFinger?r?t.translate:-t.translate:-i.currentTranslate,!s.cssMode)if(s.freeMode){if(p<-t.minTranslate())return void t.slideTo(t.activeIndex);if(p>-t.maxTranslate())return void(t.slides.length1){var v=i.velocities.pop(),f=i.velocities.pop(),m=v.position-f.position,g=v.time-f.time;t.velocity=m/g,t.velocity/=2,Math.abs(t.velocity)150||d.now()-v.time>300)&&(t.velocity=0)}else t.velocity=0;t.velocity*=s.freeModeMomentumVelocityRatio,i.velocities.length=0;var b=1e3*s.freeModeMomentumRatio,w=t.velocity*b,y=t.translate+w;r&&(y=-y);var x,E,T=!1,S=20*Math.abs(t.velocity)*s.freeModeMomentumBounceRatio;if(yt.minTranslate())s.freeModeMomentumBounce?(y-t.minTranslate()>S&&(y=t.minTranslate()+S),x=t.minTranslate(),T=!0,i.allowMomentumBounce=!0):y=t.minTranslate(),s.loop&&s.centeredSlides&&(E=!0);else if(s.freeModeSticky){for(var C,M=0;M-y){C=M;break}y=-(y=Math.abs(l[C]-y)=s.longSwipesMs)&&(t.updateProgress(),t.updateActiveIndex(),t.updateSlidesClasses())}else{for(var k=0,$=t.slidesSizesGrid[0],L=0;L=o[L]&&p=o[L]&&(k=L,$=o[o.length-1]-o[o.length-2])}var D=(p-o[k])/$,O=ks.longSwipesMs){if(!s.longSwipes)return void t.slideTo(t.activeIndex);"next"===t.swipeDirection&&(D>=s.longSwipesRatio?t.slideTo(k+O):t.slideTo(k)),"prev"===t.swipeDirection&&(D>1-s.longSwipesRatio?t.slideTo(k+O):t.slideTo(k))}else{if(!s.shortSwipes)return void t.slideTo(t.activeIndex);t.navigation&&(h.target===t.navigation.nextEl||h.target===t.navigation.prevEl)?h.target===t.navigation.nextEl?t.slideTo(k+O):t.slideTo(k):("next"===t.swipeDirection&&t.slideTo(k+O),"prev"===t.swipeDirection&&t.slideTo(k))}}}function N(){var e=this.params,t=this.el;if(!t||0!==t.offsetWidth){e.breakpoints&&this.setBreakpoint();var i=this.allowSlideNext,s=this.allowSlidePrev,a=this.snapGrid;this.allowSlideNext=!0,this.allowSlidePrev=!0,this.updateSize(),this.updateSlides(),this.updateSlidesClasses(),("auto"===e.slidesPerView||e.slidesPerView>1)&&this.isEnd&&!this.isBeginning&&!this.params.centeredSlides?this.slideTo(this.slides.length-1,0,!1,!0):this.slideTo(this.activeIndex,0,!1,!0),this.autoplay&&this.autoplay.running&&this.autoplay.paused&&this.autoplay.run(),this.allowSlidePrev=s,this.allowSlideNext=i,this.params.watchOverflow&&a!==this.snapGrid&&this.checkOverflow()}}function X(e){this.allowClick||(this.params.preventClicks&&e.preventDefault(),this.params.preventClicksPropagation&&this.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))}function V(){var e=this.wrapperEl,t=this.rtlTranslate;this.previousTranslate=this.translate,this.isHorizontal()?this.translate=t?e.scrollWidth-e.offsetWidth-e.scrollLeft:-e.scrollLeft:this.translate=-e.scrollTop,-0===this.translate&&(this.translate=0),this.updateActiveIndex(),this.updateSlidesClasses();var i=this.maxTranslate()-this.minTranslate();(0===i?0:(this.translate-this.minTranslate())/i)!==this.progress&&this.updateProgress(t?-this.translate:this.translate),this.emit("setTranslate",this.translate,!1)}var Y=!1;function F(){}var W={init:!0,direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,preventInteractionOnTransition:!1,edgeSwipeDetection:!1,edgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,slidesPerGroupSkip:0,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,watchOverflow:!1,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:0,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,loopFillGroupWithBlank:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-invisible-blank",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",runCallbacksOnInit:!0},R={update:u,translate:v,transition:f,slide:m,loop:g,grabCursor:b,manipulation:O,events:{attachEvents:function(){var e=this.params,t=this.touchEvents,s=this.el,a=this.wrapperEl;this.onTouchStart=G.bind(this),this.onTouchMove=H.bind(this),this.onTouchEnd=B.bind(this),e.cssMode&&(this.onScroll=V.bind(this)),this.onClick=X.bind(this);var r=!!e.nested;if(!h.touch&&h.pointerEvents)s.addEventListener(t.start,this.onTouchStart,!1),i.addEventListener(t.move,this.onTouchMove,r),i.addEventListener(t.end,this.onTouchEnd,!1);else{if(h.touch){var n=!("touchstart"!==t.start||!h.passiveListener||!e.passiveListeners)&&{passive:!0,capture:!1};s.addEventListener(t.start,this.onTouchStart,n),s.addEventListener(t.move,this.onTouchMove,h.passiveListener?{passive:!1,capture:r}:r),s.addEventListener(t.end,this.onTouchEnd,n),t.cancel&&s.addEventListener(t.cancel,this.onTouchEnd,n),Y||(i.addEventListener("touchstart",F),Y=!0)}(e.simulateTouch&&!A.ios&&!A.android||e.simulateTouch&&!h.touch&&A.ios)&&(s.addEventListener("mousedown",this.onTouchStart,!1),i.addEventListener("mousemove",this.onTouchMove,r),i.addEventListener("mouseup",this.onTouchEnd,!1))}(e.preventClicks||e.preventClicksPropagation)&&s.addEventListener("click",this.onClick,!0),e.cssMode&&a.addEventListener("scroll",this.onScroll),e.updateOnWindowResize?this.on(A.ios||A.android?"resize orientationchange observerUpdate":"resize observerUpdate",N,!0):this.on("observerUpdate",N,!0)},detachEvents:function(){var e=this.params,t=this.touchEvents,s=this.el,a=this.wrapperEl,r=!!e.nested;if(!h.touch&&h.pointerEvents)s.removeEventListener(t.start,this.onTouchStart,!1),i.removeEventListener(t.move,this.onTouchMove,r),i.removeEventListener(t.end,this.onTouchEnd,!1);else{if(h.touch){var n=!("onTouchStart"!==t.start||!h.passiveListener||!e.passiveListeners)&&{passive:!0,capture:!1};s.removeEventListener(t.start,this.onTouchStart,n),s.removeEventListener(t.move,this.onTouchMove,r),s.removeEventListener(t.end,this.onTouchEnd,n),t.cancel&&s.removeEventListener(t.cancel,this.onTouchEnd,n)}(e.simulateTouch&&!A.ios&&!A.android||e.simulateTouch&&!h.touch&&A.ios)&&(s.removeEventListener("mousedown",this.onTouchStart,!1),i.removeEventListener("mousemove",this.onTouchMove,r),i.removeEventListener("mouseup",this.onTouchEnd,!1))}(e.preventClicks||e.preventClicksPropagation)&&s.removeEventListener("click",this.onClick,!0),e.cssMode&&a.removeEventListener("scroll",this.onScroll),this.off(A.ios||A.android?"resize orientationchange observerUpdate":"resize observerUpdate",N)}},breakpoints:{setBreakpoint:function(){var e=this.activeIndex,t=this.initialized,i=this.loopedSlides;void 0===i&&(i=0);var s=this.params,a=this.$el,r=s.breakpoints;if(r&&(!r||0!==Object.keys(r).length)){var n=this.getBreakpoint(r);if(n&&this.currentBreakpoint!==n){var o=n in r?r[n]:void 0;o&&["slidesPerView","spaceBetween","slidesPerGroup","slidesPerGroupSkip","slidesPerColumn"].forEach((function(e){var t=o[e];void 0!==t&&(o[e]="slidesPerView"!==e||"AUTO"!==t&&"auto"!==t?"slidesPerView"===e?parseFloat(t):parseInt(t,10):"auto")}));var l=o||this.originalParams,h=s.slidesPerColumn>1,p=l.slidesPerColumn>1;h&&!p?a.removeClass(s.containerModifierClass+"multirow "+s.containerModifierClass+"multirow-column"):!h&&p&&(a.addClass(s.containerModifierClass+"multirow"),"column"===l.slidesPerColumnFill&&a.addClass(s.containerModifierClass+"multirow-column"));var c=l.direction&&l.direction!==s.direction,u=s.loop&&(l.slidesPerView!==s.slidesPerView||c);c&&t&&this.changeDirection(),d.extend(this.params,l),d.extend(this,{allowTouchMove:this.params.allowTouchMove,allowSlideNext:this.params.allowSlideNext,allowSlidePrev:this.params.allowSlidePrev}),this.currentBreakpoint=n,u&&t&&(this.loopDestroy(),this.loopCreate(),this.updateSlides(),this.slideTo(e-i+this.loopedSlides,0,!1)),this.emit("breakpoint",l)}}},getBreakpoint:function(e){if(e){var t=!1,i=Object.keys(e).map((function(e){if("string"==typeof e&&0===e.indexOf("@")){var t=parseFloat(e.substr(1));return{value:a.innerHeight*t,point:e}}return{value:e,point:e}}));i.sort((function(e,t){return parseInt(e.value,10)-parseInt(t.value,10)}));for(var s=0;s0&&e.slidesOffsetBefore+e.spaceBetween*(this.slides.length-1)+this.slides[0].offsetWidth*this.slides.length;e.slidesOffsetBefore&&e.slidesOffsetAfter&&i?this.isLocked=i<=this.size:this.isLocked=1===this.snapGrid.length,this.allowSlideNext=!this.isLocked,this.allowSlidePrev=!this.isLocked,t!==this.isLocked&&this.emit(this.isLocked?"lock":"unlock"),t&&t!==this.isLocked&&(this.isEnd=!1,this.navigation&&this.navigation.update())}},classes:{addClasses:function(){var e=this.classNames,t=this.params,i=this.rtl,s=this.$el,a=[];a.push("initialized"),a.push(t.direction),t.freeMode&&a.push("free-mode"),t.autoHeight&&a.push("autoheight"),i&&a.push("rtl"),t.slidesPerColumn>1&&(a.push("multirow"),"column"===t.slidesPerColumnFill&&a.push("multirow-column")),A.android&&a.push("android"),A.ios&&a.push("ios"),t.cssMode&&a.push("css-mode"),a.forEach((function(i){e.push(t.containerModifierClass+i)})),s.addClass(e.join(" "))},removeClasses:function(){var e=this.$el,t=this.classNames;e.removeClass(t.join(" "))}},images:{loadImage:function(e,t,i,s,r,o){var l;function d(){o&&o()}n(e).parent("picture")[0]||e.complete&&r?d():t?((l=new a.Image).onload=d,l.onerror=d,s&&(l.sizes=s),i&&(l.srcset=i),t&&(l.src=t)):d()},preloadImages:function(){var e=this;function t(){null!=e&&e&&!e.destroyed&&(void 0!==e.imagesLoaded&&(e.imagesLoaded+=1),e.imagesLoaded===e.imagesToLoad.length&&(e.params.updateOnImagesReady&&e.update(),e.emit("imagesReady")))}e.imagesToLoad=e.$el.find("img");for(var i=0;i1){var u=[];return c.each((function(e,i){var s=d.extend({},a,{el:i});u.push(new t(s))})),u}var v,f,m;return s.swiper=l,c.data("swiper",l),s&&s.shadowRoot&&s.shadowRoot.querySelector?(v=n(s.shadowRoot.querySelector("."+l.params.wrapperClass))).children=function(e){return c.children(e)}:v=c.children("."+l.params.wrapperClass),d.extend(l,{$el:c,el:s,$wrapperEl:v,wrapperEl:v[0],classNames:[],slides:n(),slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal:function(){return"horizontal"===l.params.direction},isVertical:function(){return"vertical"===l.params.direction},rtl:"rtl"===s.dir.toLowerCase()||"rtl"===c.css("direction"),rtlTranslate:"horizontal"===l.params.direction&&("rtl"===s.dir.toLowerCase()||"rtl"===c.css("direction")),wrongRTL:"-webkit-box"===v.css("display"),activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,allowSlideNext:l.params.allowSlideNext,allowSlidePrev:l.params.allowSlidePrev,touchEvents:(f=["touchstart","touchmove","touchend","touchcancel"],m=["mousedown","mousemove","mouseup"],h.pointerEvents&&(m=["pointerdown","pointermove","pointerup"]),l.touchEventsTouch={start:f[0],move:f[1],end:f[2],cancel:f[3]},l.touchEventsDesktop={start:m[0],move:m[1],end:m[2]},h.touch||!l.params.simulateTouch?l.touchEventsTouch:l.touchEventsDesktop),touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,formElements:"input, select, option, textarea, button, video, label",lastClickTime:d.now(),clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,isTouchEvent:void 0,startMoving:void 0},allowClick:!0,allowTouchMove:l.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),l.useModules(),l.params.init&&l.init(),l}}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var i={extendedDefaults:{configurable:!0},defaults:{configurable:!0},Class:{configurable:!0},$:{configurable:!0}};return t.prototype.slidesPerViewDynamic=function(){var e=this.params,t=this.slides,i=this.slidesGrid,s=this.size,a=this.activeIndex,r=1;if(e.centeredSlides){for(var n,o=t[a].swiperSlideSize,l=a+1;ls&&(n=!0));for(var d=a-1;d>=0;d-=1)t[d]&&!n&&(r+=1,(o+=t[d].swiperSlideSize)>s&&(n=!0))}else for(var h=a+1;h1)&&e.isEnd&&!e.params.centeredSlides?e.slideTo(e.slides.length-1,0,!1,!0):e.slideTo(e.activeIndex,0,!1,!0))||s(),i.watchOverflow&&t!==e.snapGrid&&e.checkOverflow(),e.emit("update")}function s(){var t=e.rtlTranslate?-1*e.translate:e.translate,i=Math.min(Math.max(t,e.maxTranslate()),e.minTranslate());e.setTranslate(i),e.updateActiveIndex(),e.updateSlidesClasses()}},t.prototype.changeDirection=function(e,t){void 0===t&&(t=!0);var i=this.params.direction;return e||(e="horizontal"===i?"vertical":"horizontal"),e===i||"horizontal"!==e&&"vertical"!==e||(this.$el.removeClass(""+this.params.containerModifierClass+i).addClass(""+this.params.containerModifierClass+e),this.params.direction=e,this.slides.each((function(t,i){"vertical"===e?i.style.width="":i.style.height=""})),this.emit("changeDirection"),t&&this.update()),this},t.prototype.init=function(){this.initialized||(this.emit("beforeInit"),this.params.breakpoints&&this.setBreakpoint(),this.addClasses(),this.params.loop&&this.loopCreate(),this.updateSize(),this.updateSlides(),this.params.watchOverflow&&this.checkOverflow(),this.params.grabCursor&&this.setGrabCursor(),this.params.preloadImages&&this.preloadImages(),this.params.loop?this.slideTo(this.params.initialSlide+this.loopedSlides,0,this.params.runCallbacksOnInit):this.slideTo(this.params.initialSlide,0,this.params.runCallbacksOnInit),this.attachEvents(),this.initialized=!0,this.emit("init"))},t.prototype.destroy=function(e,t){void 0===e&&(e=!0),void 0===t&&(t=!0);var i=this,s=i.params,a=i.$el,r=i.$wrapperEl,n=i.slides;return void 0===i.params||i.destroyed||(i.emit("beforeDestroy"),i.initialized=!1,i.detachEvents(),s.loop&&i.loopDestroy(),t&&(i.removeClasses(),a.removeAttr("style"),r.removeAttr("style"),n&&n.length&&n.removeClass([s.slideVisibleClass,s.slideActiveClass,s.slideNextClass,s.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-slide-index")),i.emit("destroy"),Object.keys(i.eventsListeners).forEach((function(e){i.off(e)})),!1!==e&&(i.$el[0].swiper=null,i.$el.data("swiper",null),d.deleteProps(i)),i.destroyed=!0),null},t.extendDefaults=function(e){d.extend(q,e)},i.extendedDefaults.get=function(){return q},i.defaults.get=function(){return W},i.Class.get=function(){return e},i.$.get=function(){return n},Object.defineProperties(t,i),t}(p),K={name:"device",proto:{device:A},static:{device:A}},U={name:"support",proto:{support:h},static:{support:h}},_={isEdge:!!a.navigator.userAgent.match(/Edge/g),isSafari:function(){var e=a.navigator.userAgent.toLowerCase();return e.indexOf("safari")>=0&&e.indexOf("chrome")<0&&e.indexOf("android")<0}(),isWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(a.navigator.userAgent)},Z={name:"browser",proto:{browser:_},static:{browser:_}},Q={name:"resize",create:function(){var e=this;d.extend(e,{resize:{resizeHandler:function(){e&&!e.destroyed&&e.initialized&&(e.emit("beforeResize"),e.emit("resize"))},orientationChangeHandler:function(){e&&!e.destroyed&&e.initialized&&e.emit("orientationchange")}}})},on:{init:function(){a.addEventListener("resize",this.resize.resizeHandler),a.addEventListener("orientationchange",this.resize.orientationChangeHandler)},destroy:function(){a.removeEventListener("resize",this.resize.resizeHandler),a.removeEventListener("orientationchange",this.resize.orientationChangeHandler)}}},J={func:a.MutationObserver||a.WebkitMutationObserver,attach:function(e,t){void 0===t&&(t={});var i=this,s=new(0,J.func)((function(e){if(1!==e.length){var t=function(){i.emit("observerUpdate",e[0])};a.requestAnimationFrame?a.requestAnimationFrame(t):a.setTimeout(t,0)}else i.emit("observerUpdate",e[0])}));s.observe(e,{attributes:void 0===t.attributes||t.attributes,childList:void 0===t.childList||t.childList,characterData:void 0===t.characterData||t.characterData}),i.observer.observers.push(s)},init:function(){if(h.observer&&this.params.observer){if(this.params.observeParents)for(var e=this.$el.parents(),t=0;tE)&&t.$wrapperEl.find("."+t.params.slideClass+'[data-swiper-slide-index="'+P+'"]').remove();for(var z=0;z=x&&z<=E&&(void 0===c||e?M.push(z):(z>c&&M.push(z),z'+e+"
");return s.attr("data-swiper-slide-index")||s.attr("data-swiper-slide-index",t),i.cache&&(this.virtual.cache[t]=s),s},appendSlide:function(e){if("object"==typeof e&&"length"in e)for(var t=0;t=0;i-=1)this.virtual.slides.splice(e[i],1),this.params.virtual.cache&&delete this.virtual.cache[e[i]],e[i]0&&0===this.$el.parents("."+this.params.slideActiveClass).length)return;var v=a.innerWidth,f=a.innerHeight,m=this.$el.offset();t&&(m.left-=this.$el[0].scrollLeft);for(var g=[[m.left,m.top],[m.left+this.width,m.top],[m.left,m.top+this.height],[m.left+this.width,m.top+this.height]],b=0;b=0&&w[0]<=v&&w[1]>=0&&w[1]<=f&&(u=!0)}if(!u)return}this.isHorizontal()?((o||l||d||h)&&(s.preventDefault?s.preventDefault():s.returnValue=!1),((l||h)&&!t||(o||d)&&t)&&this.slideNext(),((o||d)&&!t||(l||h)&&t)&&this.slidePrev()):((o||l||p||c)&&(s.preventDefault?s.preventDefault():s.returnValue=!1),(l||c)&&this.slideNext(),(o||p)&&this.slidePrev()),this.emit("keyPress",r)}},enable:function(){this.keyboard.enabled||(n(i).on("keydown",this.keyboard.handle),this.keyboard.enabled=!0)},disable:function(){this.keyboard.enabled&&(n(i).off("keydown",this.keyboard.handle),this.keyboard.enabled=!1)}},ae={name:"keyboard",params:{keyboard:{enabled:!1,onlyInViewport:!0,pageUpDown:!0}},create:function(){d.extend(this,{keyboard:{enabled:!1,enable:se.enable.bind(this),disable:se.disable.bind(this),handle:se.handle.bind(this)}})},on:{init:function(){this.params.keyboard.enabled&&this.keyboard.enable()},destroy:function(){this.keyboard.enabled&&this.keyboard.disable()}}};var re={lastScrollTime:d.now(),lastEventBeforeSnap:void 0,recentWheelEvents:[],event:function(){return a.navigator.userAgent.indexOf("firefox")>-1?"DOMMouseScroll":function(){var e="onwheel"in i;if(!e){var t=i.createElement("div");t.setAttribute("onwheel","return;"),e="function"==typeof t.onwheel}return!e&&i.implementation&&i.implementation.hasFeature&&!0!==i.implementation.hasFeature("","")&&(e=i.implementation.hasFeature("Events.wheel","3.0")),e}()?"wheel":"mousewheel"},normalize:function(e){var t=0,i=0,s=0,a=0;return"detail"in e&&(i=e.detail),"wheelDelta"in e&&(i=-e.wheelDelta/120),"wheelDeltaY"in e&&(i=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=i,i=0),s=10*t,a=10*i,"deltaY"in e&&(a=e.deltaY),"deltaX"in e&&(s=e.deltaX),e.shiftKey&&!s&&(s=a,a=0),(s||a)&&e.deltaMode&&(1===e.deltaMode?(s*=40,a*=40):(s*=800,a*=800)),s&&!t&&(t=s<1?-1:1),a&&!i&&(i=a<1?-1:1),{spinX:t,spinY:i,pixelX:s,pixelY:a}},handleMouseEnter:function(){this.mouseEntered=!0},handleMouseLeave:function(){this.mouseEntered=!1},handle:function(e){var t=e,i=this,s=i.params.mousewheel;i.params.cssMode&&t.preventDefault();var a=i.$el;if("container"!==i.params.mousewheel.eventsTarged&&(a=n(i.params.mousewheel.eventsTarged)),!i.mouseEntered&&!a[0].contains(t.target)&&!s.releaseOnEdges)return!0;t.originalEvent&&(t=t.originalEvent);var r=0,o=i.rtlTranslate?-1:1,l=re.normalize(t);if(s.forceToAxis)if(i.isHorizontal()){if(!(Math.abs(l.pixelX)>Math.abs(l.pixelY)))return!0;r=-l.pixelX*o}else{if(!(Math.abs(l.pixelY)>Math.abs(l.pixelX)))return!0;r=-l.pixelY}else r=Math.abs(l.pixelX)>Math.abs(l.pixelY)?-l.pixelX*o:-l.pixelY;if(0===r)return!0;if(s.invert&&(r=-r),i.params.freeMode){var h={time:d.now(),delta:Math.abs(r),direction:Math.sign(r)},p=i.mousewheel.lastEventBeforeSnap,c=p&&h.time=i.minTranslate()&&(u=i.minTranslate()),u<=i.maxTranslate()&&(u=i.maxTranslate()),i.setTransition(0),i.setTranslate(u),i.updateProgress(),i.updateActiveIndex(),i.updateSlidesClasses(),(!v&&i.isBeginning||!f&&i.isEnd)&&i.updateSlidesClasses(),i.params.freeModeSticky){clearTimeout(i.mousewheel.timeout),i.mousewheel.timeout=void 0;var m=i.mousewheel.recentWheelEvents;m.length>=15&&m.shift();var g=m.length?m[m.length-1]:void 0,b=m[0];if(m.push(h),g&&(h.delta>g.delta||h.direction!==g.direction))m.splice(0);else if(m.length>=15&&h.time-b.time<500&&b.delta-h.delta>=1&&h.delta<=6){var w=r>0?.8:.2;i.mousewheel.lastEventBeforeSnap=h,m.splice(0),i.mousewheel.timeout=d.nextTick((function(){i.slideToClosest(i.params.speed,!0,void 0,w)}),0)}i.mousewheel.timeout||(i.mousewheel.timeout=d.nextTick((function(){i.mousewheel.lastEventBeforeSnap=h,m.splice(0),i.slideToClosest(i.params.speed,!0,void 0,.5)}),500))}if(c||i.emit("scroll",t),i.params.autoplay&&i.params.autoplayDisableOnInteraction&&i.autoplay.stop(),u===i.minTranslate()||u===i.maxTranslate())return!0}}else{var y={time:d.now(),delta:Math.abs(r),direction:Math.sign(r),raw:e},x=i.mousewheel.recentWheelEvents;x.length>=2&&x.shift();var E=x.length?x[x.length-1]:void 0;if(x.push(y),E?(y.direction!==E.direction||y.delta>E.delta||y.time>E.time+150)&&i.mousewheel.animateSlider(y):i.mousewheel.animateSlider(y),i.mousewheel.releaseScroll(y))return!0}return t.preventDefault?t.preventDefault():t.returnValue=!1,!1},animateSlider:function(e){return e.delta>=6&&d.now()-this.mousewheel.lastScrollTime<60||(e.direction<0?this.isEnd&&!this.params.loop||this.animating||(this.slideNext(),this.emit("scroll",e.raw)):this.isBeginning&&!this.params.loop||this.animating||(this.slidePrev(),this.emit("scroll",e.raw)),this.mousewheel.lastScrollTime=(new a.Date).getTime(),!1)},releaseScroll:function(e){var t=this.params.mousewheel;if(e.direction<0){if(this.isEnd&&!this.params.loop&&t.releaseOnEdges)return!0}else if(this.isBeginning&&!this.params.loop&&t.releaseOnEdges)return!0;return!1},enable:function(){var e=re.event();if(this.params.cssMode)return this.wrapperEl.removeEventListener(e,this.mousewheel.handle),!0;if(!e)return!1;if(this.mousewheel.enabled)return!1;var t=this.$el;return"container"!==this.params.mousewheel.eventsTarged&&(t=n(this.params.mousewheel.eventsTarged)),t.on("mouseenter",this.mousewheel.handleMouseEnter),t.on("mouseleave",this.mousewheel.handleMouseLeave),t.on(e,this.mousewheel.handle),this.mousewheel.enabled=!0,!0},disable:function(){var e=re.event();if(this.params.cssMode)return this.wrapperEl.addEventListener(e,this.mousewheel.handle),!0;if(!e)return!1;if(!this.mousewheel.enabled)return!1;var t=this.$el;return"container"!==this.params.mousewheel.eventsTarged&&(t=n(this.params.mousewheel.eventsTarged)),t.off(e,this.mousewheel.handle),this.mousewheel.enabled=!1,!0}},ne={update:function(){var e=this.params.navigation;if(!this.params.loop){var t=this.navigation,i=t.$nextEl,s=t.$prevEl;s&&s.length>0&&(this.isBeginning?s.addClass(e.disabledClass):s.removeClass(e.disabledClass),s[this.params.watchOverflow&&this.isLocked?"addClass":"removeClass"](e.lockClass)),i&&i.length>0&&(this.isEnd?i.addClass(e.disabledClass):i.removeClass(e.disabledClass),i[this.params.watchOverflow&&this.isLocked?"addClass":"removeClass"](e.lockClass))}},onPrevClick:function(e){e.preventDefault(),this.isBeginning&&!this.params.loop||this.slidePrev()},onNextClick:function(e){e.preventDefault(),this.isEnd&&!this.params.loop||this.slideNext()},init:function(){var e,t,i=this.params.navigation;(i.nextEl||i.prevEl)&&(i.nextEl&&(e=n(i.nextEl),this.params.uniqueNavElements&&"string"==typeof i.nextEl&&e.length>1&&1===this.$el.find(i.nextEl).length&&(e=this.$el.find(i.nextEl))),i.prevEl&&(t=n(i.prevEl),this.params.uniqueNavElements&&"string"==typeof i.prevEl&&t.length>1&&1===this.$el.find(i.prevEl).length&&(t=this.$el.find(i.prevEl))),e&&e.length>0&&e.on("click",this.navigation.onNextClick),t&&t.length>0&&t.on("click",this.navigation.onPrevClick),d.extend(this.navigation,{$nextEl:e,nextEl:e&&e[0],$prevEl:t,prevEl:t&&t[0]}))},destroy:function(){var e=this.navigation,t=e.$nextEl,i=e.$prevEl;t&&t.length&&(t.off("click",this.navigation.onNextClick),t.removeClass(this.params.navigation.disabledClass)),i&&i.length&&(i.off("click",this.navigation.onPrevClick),i.removeClass(this.params.navigation.disabledClass))}},oe={update:function(){var e=this.rtl,t=this.params.pagination;if(t.el&&this.pagination.el&&this.pagination.$el&&0!==this.pagination.$el.length){var i,s=this.virtual&&this.params.virtual.enabled?this.virtual.slides.length:this.slides.length,a=this.pagination.$el,r=this.params.loop?Math.ceil((s-2*this.loopedSlides)/this.params.slidesPerGroup):this.snapGrid.length;if(this.params.loop?((i=Math.ceil((this.activeIndex-this.loopedSlides)/this.params.slidesPerGroup))>s-1-2*this.loopedSlides&&(i-=s-2*this.loopedSlides),i>r-1&&(i-=r),i<0&&"bullets"!==this.params.paginationType&&(i=r+i)):i=void 0!==this.snapIndex?this.snapIndex:this.activeIndex||0,"bullets"===t.type&&this.pagination.bullets&&this.pagination.bullets.length>0){var o,l,d,h=this.pagination.bullets;if(t.dynamicBullets&&(this.pagination.bulletSize=h.eq(0)[this.isHorizontal()?"outerWidth":"outerHeight"](!0),a.css(this.isHorizontal()?"width":"height",this.pagination.bulletSize*(t.dynamicMainBullets+4)+"px"),t.dynamicMainBullets>1&&void 0!==this.previousIndex&&(this.pagination.dynamicBulletIndex+=i-this.previousIndex,this.pagination.dynamicBulletIndex>t.dynamicMainBullets-1?this.pagination.dynamicBulletIndex=t.dynamicMainBullets-1:this.pagination.dynamicBulletIndex<0&&(this.pagination.dynamicBulletIndex=0)),o=i-this.pagination.dynamicBulletIndex,d=((l=o+(Math.min(h.length,t.dynamicMainBullets)-1))+o)/2),h.removeClass(t.bulletActiveClass+" "+t.bulletActiveClass+"-next "+t.bulletActiveClass+"-next-next "+t.bulletActiveClass+"-prev "+t.bulletActiveClass+"-prev-prev "+t.bulletActiveClass+"-main"),a.length>1)h.each((function(e,s){var a=n(s),r=a.index();r===i&&a.addClass(t.bulletActiveClass),t.dynamicBullets&&(r>=o&&r<=l&&a.addClass(t.bulletActiveClass+"-main"),r===o&&a.prev().addClass(t.bulletActiveClass+"-prev").prev().addClass(t.bulletActiveClass+"-prev-prev"),r===l&&a.next().addClass(t.bulletActiveClass+"-next").next().addClass(t.bulletActiveClass+"-next-next"))}));else{var p=h.eq(i),c=p.index();if(p.addClass(t.bulletActiveClass),t.dynamicBullets){for(var u=h.eq(o),v=h.eq(l),f=o;f<=l;f+=1)h.eq(f).addClass(t.bulletActiveClass+"-main");if(this.params.loop)if(c>=h.length-t.dynamicMainBullets){for(var m=t.dynamicMainBullets;m>=0;m-=1)h.eq(h.length-m).addClass(t.bulletActiveClass+"-main");h.eq(h.length-t.dynamicMainBullets-1).addClass(t.bulletActiveClass+"-prev")}else u.prev().addClass(t.bulletActiveClass+"-prev").prev().addClass(t.bulletActiveClass+"-prev-prev"),v.next().addClass(t.bulletActiveClass+"-next").next().addClass(t.bulletActiveClass+"-next-next");else u.prev().addClass(t.bulletActiveClass+"-prev").prev().addClass(t.bulletActiveClass+"-prev-prev"),v.next().addClass(t.bulletActiveClass+"-next").next().addClass(t.bulletActiveClass+"-next-next")}}if(t.dynamicBullets){var g=Math.min(h.length,t.dynamicMainBullets+4),b=(this.pagination.bulletSize*g-this.pagination.bulletSize)/2-d*this.pagination.bulletSize,w=e?"right":"left";h.css(this.isHorizontal()?w:"top",b+"px")}}if("fraction"===t.type&&(a.find("."+t.currentClass).text(t.formatFractionCurrent(i+1)),a.find("."+t.totalClass).text(t.formatFractionTotal(r))),"progressbar"===t.type){var y;y=t.progressbarOpposite?this.isHorizontal()?"vertical":"horizontal":this.isHorizontal()?"horizontal":"vertical";var x=(i+1)/r,E=1,T=1;"horizontal"===y?E=x:T=x,a.find("."+t.progressbarFillClass).transform("translate3d(0,0,0) scaleX("+E+") scaleY("+T+")").transition(this.params.speed)}"custom"===t.type&&t.renderCustom?(a.html(t.renderCustom(this,i+1,r)),this.emit("paginationRender",this,a[0])):this.emit("paginationUpdate",this,a[0]),a[this.params.watchOverflow&&this.isLocked?"addClass":"removeClass"](t.lockClass)}},render:function(){var e=this.params.pagination;if(e.el&&this.pagination.el&&this.pagination.$el&&0!==this.pagination.$el.length){var t=this.virtual&&this.params.virtual.enabled?this.virtual.slides.length:this.slides.length,i=this.pagination.$el,s="";if("bullets"===e.type){for(var a=this.params.loop?Math.ceil((t-2*this.loopedSlides)/this.params.slidesPerGroup):this.snapGrid.length,r=0;r";i.html(s),this.pagination.bullets=i.find("."+e.bulletClass)}"fraction"===e.type&&(s=e.renderFraction?e.renderFraction.call(this,e.currentClass,e.totalClass):' / ',i.html(s)),"progressbar"===e.type&&(s=e.renderProgressbar?e.renderProgressbar.call(this,e.progressbarFillClass):'',i.html(s)),"custom"!==e.type&&this.emit("paginationRender",this.pagination.$el[0])}},init:function(){var e=this,t=e.params.pagination;if(t.el){var i=n(t.el);0!==i.length&&(e.params.uniqueNavElements&&"string"==typeof t.el&&i.length>1&&(i=e.$el.find(t.el)),"bullets"===t.type&&t.clickable&&i.addClass(t.clickableClass),i.addClass(t.modifierClass+t.type),"bullets"===t.type&&t.dynamicBullets&&(i.addClass(""+t.modifierClass+t.type+"-dynamic"),e.pagination.dynamicBulletIndex=0,t.dynamicMainBullets<1&&(t.dynamicMainBullets=1)),"progressbar"===t.type&&t.progressbarOpposite&&i.addClass(t.progressbarOppositeClass),t.clickable&&i.on("click","."+t.bulletClass,(function(t){t.preventDefault();var i=n(this).index()*e.params.slidesPerGroup;e.params.loop&&(i+=e.loopedSlides),e.slideTo(i)})),d.extend(e.pagination,{$el:i,el:i[0]}))}},destroy:function(){var e=this.params.pagination;if(e.el&&this.pagination.el&&this.pagination.$el&&0!==this.pagination.$el.length){var t=this.pagination.$el;t.removeClass(e.hiddenClass),t.removeClass(e.modifierClass+e.type),this.pagination.bullets&&this.pagination.bullets.removeClass(e.bulletActiveClass),e.clickable&&t.off("click","."+e.bulletClass)}}},le={setTranslate:function(){if(this.params.scrollbar.el&&this.scrollbar.el){var e=this.scrollbar,t=this.rtlTranslate,i=this.progress,s=e.dragSize,a=e.trackSize,r=e.$dragEl,n=e.$el,o=this.params.scrollbar,l=s,d=(a-s)*i;t?(d=-d)>0?(l=s-d,d=0):-d+s>a&&(l=a+d):d<0?(l=s+d,d=0):d+s>a&&(l=a-d),this.isHorizontal()?(r.transform("translate3d("+d+"px, 0, 0)"),r[0].style.width=l+"px"):(r.transform("translate3d(0px, "+d+"px, 0)"),r[0].style.height=l+"px"),o.hide&&(clearTimeout(this.scrollbar.timeout),n[0].style.opacity=1,this.scrollbar.timeout=setTimeout((function(){n[0].style.opacity=0,n.transition(400)}),1e3))}},setTransition:function(e){this.params.scrollbar.el&&this.scrollbar.el&&this.scrollbar.$dragEl.transition(e)},updateSize:function(){if(this.params.scrollbar.el&&this.scrollbar.el){var e=this.scrollbar,t=e.$dragEl,i=e.$el;t[0].style.width="",t[0].style.height="";var s,a=this.isHorizontal()?i[0].offsetWidth:i[0].offsetHeight,r=this.size/this.virtualSize,n=r*(a/this.size);s="auto"===this.params.scrollbar.dragSize?a*r:parseInt(this.params.scrollbar.dragSize,10),this.isHorizontal()?t[0].style.width=s+"px":t[0].style.height=s+"px",i[0].style.display=r>=1?"none":"",this.params.scrollbar.hide&&(i[0].style.opacity=0),d.extend(e,{trackSize:a,divider:r,moveDivider:n,dragSize:s}),e.$el[this.params.watchOverflow&&this.isLocked?"addClass":"removeClass"](this.params.scrollbar.lockClass)}},getPointerPosition:function(e){return this.isHorizontal()?"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].clientX:e.clientX:"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].clientY:e.clientY},setDragPosition:function(e){var t,i=this.scrollbar,s=this.rtlTranslate,a=i.$el,r=i.dragSize,n=i.trackSize,o=i.dragStartPos;t=(i.getPointerPosition(e)-a.offset()[this.isHorizontal()?"left":"top"]-(null!==o?o:r/2))/(n-r),t=Math.max(Math.min(t,1),0),s&&(t=1-t);var l=this.minTranslate()+(this.maxTranslate()-this.minTranslate())*t;this.updateProgress(l),this.setTranslate(l),this.updateActiveIndex(),this.updateSlidesClasses()},onDragStart:function(e){var t=this.params.scrollbar,i=this.scrollbar,s=this.$wrapperEl,a=i.$el,r=i.$dragEl;this.scrollbar.isTouched=!0,this.scrollbar.dragStartPos=e.target===r[0]||e.target===r?i.getPointerPosition(e)-e.target.getBoundingClientRect()[this.isHorizontal()?"left":"top"]:null,e.preventDefault(),e.stopPropagation(),s.transition(100),r.transition(100),i.setDragPosition(e),clearTimeout(this.scrollbar.dragTimeout),a.transition(0),t.hide&&a.css("opacity",1),this.params.cssMode&&this.$wrapperEl.css("scroll-snap-type","none"),this.emit("scrollbarDragStart",e)},onDragMove:function(e){var t=this.scrollbar,i=this.$wrapperEl,s=t.$el,a=t.$dragEl;this.scrollbar.isTouched&&(e.preventDefault?e.preventDefault():e.returnValue=!1,t.setDragPosition(e),i.transition(0),s.transition(0),a.transition(0),this.emit("scrollbarDragMove",e))},onDragEnd:function(e){var t=this.params.scrollbar,i=this.scrollbar,s=this.$wrapperEl,a=i.$el;this.scrollbar.isTouched&&(this.scrollbar.isTouched=!1,this.params.cssMode&&(this.$wrapperEl.css("scroll-snap-type",""),s.transition("")),t.hide&&(clearTimeout(this.scrollbar.dragTimeout),this.scrollbar.dragTimeout=d.nextTick((function(){a.css("opacity",0),a.transition(400)}),1e3)),this.emit("scrollbarDragEnd",e),t.snapOnRelease&&this.slideToClosest())},enableDraggable:function(){if(this.params.scrollbar.el){var e=this.scrollbar,t=this.touchEventsTouch,s=this.touchEventsDesktop,a=this.params,r=e.$el[0],n=!(!h.passiveListener||!a.passiveListeners)&&{passive:!1,capture:!1},o=!(!h.passiveListener||!a.passiveListeners)&&{passive:!0,capture:!1};h.touch?(r.addEventListener(t.start,this.scrollbar.onDragStart,n),r.addEventListener(t.move,this.scrollbar.onDragMove,n),r.addEventListener(t.end,this.scrollbar.onDragEnd,o)):(r.addEventListener(s.start,this.scrollbar.onDragStart,n),i.addEventListener(s.move,this.scrollbar.onDragMove,n),i.addEventListener(s.end,this.scrollbar.onDragEnd,o))}},disableDraggable:function(){if(this.params.scrollbar.el){var e=this.scrollbar,t=this.touchEventsTouch,s=this.touchEventsDesktop,a=this.params,r=e.$el[0],n=!(!h.passiveListener||!a.passiveListeners)&&{passive:!1,capture:!1},o=!(!h.passiveListener||!a.passiveListeners)&&{passive:!0,capture:!1};h.touch?(r.removeEventListener(t.start,this.scrollbar.onDragStart,n),r.removeEventListener(t.move,this.scrollbar.onDragMove,n),r.removeEventListener(t.end,this.scrollbar.onDragEnd,o)):(r.removeEventListener(s.start,this.scrollbar.onDragStart,n),i.removeEventListener(s.move,this.scrollbar.onDragMove,n),i.removeEventListener(s.end,this.scrollbar.onDragEnd,o))}},init:function(){if(this.params.scrollbar.el){var e=this.scrollbar,t=this.$el,i=this.params.scrollbar,s=n(i.el);this.params.uniqueNavElements&&"string"==typeof i.el&&s.length>1&&1===t.find(i.el).length&&(s=t.find(i.el));var a=s.find("."+this.params.scrollbar.dragClass);0===a.length&&(a=n('
'),s.append(a)),d.extend(e,{$el:s,el:s[0],$dragEl:a,dragEl:a[0]}),i.draggable&&e.enableDraggable()}},destroy:function(){this.scrollbar.disableDraggable()}},de={setTransform:function(e,t){var i=this.rtl,s=n(e),a=i?-1:1,r=s.attr("data-swiper-parallax")||"0",o=s.attr("data-swiper-parallax-x"),l=s.attr("data-swiper-parallax-y"),d=s.attr("data-swiper-parallax-scale"),h=s.attr("data-swiper-parallax-opacity");if(o||l?(o=o||"0",l=l||"0"):this.isHorizontal()?(o=r,l="0"):(l=r,o="0"),o=o.indexOf("%")>=0?parseInt(o,10)*t*a+"%":o*t*a+"px",l=l.indexOf("%")>=0?parseInt(l,10)*t+"%":l*t+"px",null!=h){var p=h-(h-1)*(1-Math.abs(t));s[0].style.opacity=p}if(null==d)s.transform("translate3d("+o+", "+l+", 0px)");else{var c=d-(d-1)*(1-Math.abs(t));s.transform("translate3d("+o+", "+l+", 0px) scale("+c+")")}},setTranslate:function(){var e=this,t=e.$el,i=e.slides,s=e.progress,a=e.snapGrid;t.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((function(t,i){e.parallax.setTransform(i,s)})),i.each((function(t,i){var r=i.progress;e.params.slidesPerGroup>1&&"auto"!==e.params.slidesPerView&&(r+=Math.ceil(t/2)-s*(a.length-1)),r=Math.min(Math.max(r,-1),1),n(i).find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((function(t,i){e.parallax.setTransform(i,r)}))}))},setTransition:function(e){void 0===e&&(e=this.params.speed);this.$el.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y], [data-swiper-parallax-opacity], [data-swiper-parallax-scale]").each((function(t,i){var s=n(i),a=parseInt(s.attr("data-swiper-parallax-duration"),10)||e;0===e&&(a=0),s.transition(a)}))}},he={getDistanceBetweenTouches:function(e){if(e.targetTouches.length<2)return 1;var t=e.targetTouches[0].pageX,i=e.targetTouches[0].pageY,s=e.targetTouches[1].pageX,a=e.targetTouches[1].pageY;return Math.sqrt(Math.pow(s-t,2)+Math.pow(a-i,2))},onGestureStart:function(e){var t=this.params.zoom,i=this.zoom,s=i.gesture;if(i.fakeGestureTouched=!1,i.fakeGestureMoved=!1,!h.gestures){if("touchstart"!==e.type||"touchstart"===e.type&&e.targetTouches.length<2)return;i.fakeGestureTouched=!0,s.scaleStart=he.getDistanceBetweenTouches(e)}s.$slideEl&&s.$slideEl.length||(s.$slideEl=n(e.target).closest("."+this.params.slideClass),0===s.$slideEl.length&&(s.$slideEl=this.slides.eq(this.activeIndex)),s.$imageEl=s.$slideEl.find("img, svg, canvas, picture, .swiper-zoom-target"),s.$imageWrapEl=s.$imageEl.parent("."+t.containerClass),s.maxRatio=s.$imageWrapEl.attr("data-swiper-zoom")||t.maxRatio,0!==s.$imageWrapEl.length)?(s.$imageEl&&s.$imageEl.transition(0),this.zoom.isScaling=!0):s.$imageEl=void 0},onGestureChange:function(e){var t=this.params.zoom,i=this.zoom,s=i.gesture;if(!h.gestures){if("touchmove"!==e.type||"touchmove"===e.type&&e.targetTouches.length<2)return;i.fakeGestureMoved=!0,s.scaleMove=he.getDistanceBetweenTouches(e)}s.$imageEl&&0!==s.$imageEl.length&&(i.scale=h.gestures?e.scale*i.currentScale:s.scaleMove/s.scaleStart*i.currentScale,i.scale>s.maxRatio&&(i.scale=s.maxRatio-1+Math.pow(i.scale-s.maxRatio+1,.5)),i.scales.touchesStart.x))return void(s.isTouched=!1);if(!this.isHorizontal()&&(Math.floor(s.minY)===Math.floor(s.startY)&&s.touchesCurrent.ys.touchesStart.y))return void(s.isTouched=!1)}e.cancelable&&e.preventDefault(),e.stopPropagation(),s.isMoved=!0,s.currentX=s.touchesCurrent.x-s.touchesStart.x+s.startX,s.currentY=s.touchesCurrent.y-s.touchesStart.y+s.startY,s.currentXs.maxX&&(s.currentX=s.maxX-1+Math.pow(s.currentX-s.maxX+1,.8)),s.currentYs.maxY&&(s.currentY=s.maxY-1+Math.pow(s.currentY-s.maxY+1,.8)),a.prevPositionX||(a.prevPositionX=s.touchesCurrent.x),a.prevPositionY||(a.prevPositionY=s.touchesCurrent.y),a.prevTime||(a.prevTime=Date.now()),a.x=(s.touchesCurrent.x-a.prevPositionX)/(Date.now()-a.prevTime)/2,a.y=(s.touchesCurrent.y-a.prevPositionY)/(Date.now()-a.prevTime)/2,Math.abs(s.touchesCurrent.x-a.prevPositionX)<2&&(a.x=0),Math.abs(s.touchesCurrent.y-a.prevPositionY)<2&&(a.y=0),a.prevPositionX=s.touchesCurrent.x,a.prevPositionY=s.touchesCurrent.y,a.prevTime=Date.now(),i.$imageWrapEl.transform("translate3d("+s.currentX+"px, "+s.currentY+"px,0)")}}},onTouchEnd:function(){var e=this.zoom,t=e.gesture,i=e.image,s=e.velocity;if(t.$imageEl&&0!==t.$imageEl.length){if(!i.isTouched||!i.isMoved)return i.isTouched=!1,void(i.isMoved=!1);i.isTouched=!1,i.isMoved=!1;var a=300,r=300,n=s.x*a,o=i.currentX+n,l=s.y*r,d=i.currentY+l;0!==s.x&&(a=Math.abs((o-i.currentX)/s.x)),0!==s.y&&(r=Math.abs((d-i.currentY)/s.y));var h=Math.max(a,r);i.currentX=o,i.currentY=d;var p=i.width*e.scale,c=i.height*e.scale;i.minX=Math.min(t.slideWidth/2-p/2,0),i.maxX=-i.minX,i.minY=Math.min(t.slideHeight/2-c/2,0),i.maxY=-i.minY,i.currentX=Math.max(Math.min(i.currentX,i.maxX),i.minX),i.currentY=Math.max(Math.min(i.currentY,i.maxY),i.minY),t.$imageWrapEl.transition(h).transform("translate3d("+i.currentX+"px, "+i.currentY+"px,0)")}},onTransitionEnd:function(){var e=this.zoom,t=e.gesture;t.$slideEl&&this.previousIndex!==this.activeIndex&&(t.$imageEl&&t.$imageEl.transform("translate3d(0,0,0) scale(1)"),t.$imageWrapEl&&t.$imageWrapEl.transform("translate3d(0,0,0)"),e.scale=1,e.currentScale=1,t.$slideEl=void 0,t.$imageEl=void 0,t.$imageWrapEl=void 0)},toggle:function(e){var t=this.zoom;t.scale&&1!==t.scale?t.out():t.in(e)},in:function(e){var t,i,s,a,r,n,o,l,d,h,p,c,u,v,f,m,g=this.zoom,b=this.params.zoom,w=g.gesture,y=g.image;(w.$slideEl||(this.params.virtual&&this.params.virtual.enabled&&this.virtual?w.$slideEl=this.$wrapperEl.children("."+this.params.slideActiveClass):w.$slideEl=this.slides.eq(this.activeIndex),w.$imageEl=w.$slideEl.find("img, svg, canvas, picture, .swiper-zoom-target"),w.$imageWrapEl=w.$imageEl.parent("."+b.containerClass)),w.$imageEl&&0!==w.$imageEl.length)&&(w.$slideEl.addClass(""+b.zoomedSlideClass),void 0===y.touchesStart.x&&e?(t="touchend"===e.type?e.changedTouches[0].pageX:e.pageX,i="touchend"===e.type?e.changedTouches[0].pageY:e.pageY):(t=y.touchesStart.x,i=y.touchesStart.y),g.scale=w.$imageWrapEl.attr("data-swiper-zoom")||b.maxRatio,g.currentScale=w.$imageWrapEl.attr("data-swiper-zoom")||b.maxRatio,e?(f=w.$slideEl[0].offsetWidth,m=w.$slideEl[0].offsetHeight,s=w.$slideEl.offset().left+f/2-t,a=w.$slideEl.offset().top+m/2-i,o=w.$imageEl[0].offsetWidth,l=w.$imageEl[0].offsetHeight,d=o*g.scale,h=l*g.scale,u=-(p=Math.min(f/2-d/2,0)),v=-(c=Math.min(m/2-h/2,0)),(r=s*g.scale)u&&(r=u),(n=a*g.scale)v&&(n=v)):(r=0,n=0),w.$imageWrapEl.transition(300).transform("translate3d("+r+"px, "+n+"px,0)"),w.$imageEl.transition(300).transform("translate3d(0,0,0) scale("+g.scale+")"))},out:function(){var e=this.zoom,t=this.params.zoom,i=e.gesture;i.$slideEl||(this.params.virtual&&this.params.virtual.enabled&&this.virtual?i.$slideEl=this.$wrapperEl.children("."+this.params.slideActiveClass):i.$slideEl=this.slides.eq(this.activeIndex),i.$imageEl=i.$slideEl.find("img, svg, canvas, picture, .swiper-zoom-target"),i.$imageWrapEl=i.$imageEl.parent("."+t.containerClass)),i.$imageEl&&0!==i.$imageEl.length&&(e.scale=1,e.currentScale=1,i.$imageWrapEl.transition(300).transform("translate3d(0,0,0)"),i.$imageEl.transition(300).transform("translate3d(0,0,0) scale(1)"),i.$slideEl.removeClass(""+t.zoomedSlideClass),i.$slideEl=void 0)},enable:function(){var e=this.zoom;if(!e.enabled){e.enabled=!0;var t=!("touchstart"!==this.touchEvents.start||!h.passiveListener||!this.params.passiveListeners)&&{passive:!0,capture:!1},i=!h.passiveListener||{passive:!1,capture:!0},s="."+this.params.slideClass;h.gestures?(this.$wrapperEl.on("gesturestart",s,e.onGestureStart,t),this.$wrapperEl.on("gesturechange",s,e.onGestureChange,t),this.$wrapperEl.on("gestureend",s,e.onGestureEnd,t)):"touchstart"===this.touchEvents.start&&(this.$wrapperEl.on(this.touchEvents.start,s,e.onGestureStart,t),this.$wrapperEl.on(this.touchEvents.move,s,e.onGestureChange,i),this.$wrapperEl.on(this.touchEvents.end,s,e.onGestureEnd,t),this.touchEvents.cancel&&this.$wrapperEl.on(this.touchEvents.cancel,s,e.onGestureEnd,t)),this.$wrapperEl.on(this.touchEvents.move,"."+this.params.zoom.containerClass,e.onTouchMove,i)}},disable:function(){var e=this.zoom;if(e.enabled){this.zoom.enabled=!1;var t=!("touchstart"!==this.touchEvents.start||!h.passiveListener||!this.params.passiveListeners)&&{passive:!0,capture:!1},i=!h.passiveListener||{passive:!1,capture:!0},s="."+this.params.slideClass;h.gestures?(this.$wrapperEl.off("gesturestart",s,e.onGestureStart,t),this.$wrapperEl.off("gesturechange",s,e.onGestureChange,t),this.$wrapperEl.off("gestureend",s,e.onGestureEnd,t)):"touchstart"===this.touchEvents.start&&(this.$wrapperEl.off(this.touchEvents.start,s,e.onGestureStart,t),this.$wrapperEl.off(this.touchEvents.move,s,e.onGestureChange,i),this.$wrapperEl.off(this.touchEvents.end,s,e.onGestureEnd,t),this.touchEvents.cancel&&this.$wrapperEl.off(this.touchEvents.cancel,s,e.onGestureEnd,t)),this.$wrapperEl.off(this.touchEvents.move,"."+this.params.zoom.containerClass,e.onTouchMove,i)}}},pe={loadInSlide:function(e,t){void 0===t&&(t=!0);var i=this,s=i.params.lazy;if(void 0!==e&&0!==i.slides.length){var a=i.virtual&&i.params.virtual.enabled?i.$wrapperEl.children("."+i.params.slideClass+'[data-swiper-slide-index="'+e+'"]'):i.slides.eq(e),r=a.find("."+s.elementClass+":not(."+s.loadedClass+"):not(."+s.loadingClass+")");!a.hasClass(s.elementClass)||a.hasClass(s.loadedClass)||a.hasClass(s.loadingClass)||(r=r.add(a[0])),0!==r.length&&r.each((function(e,r){var o=n(r);o.addClass(s.loadingClass);var l=o.attr("data-background"),d=o.attr("data-src"),h=o.attr("data-srcset"),p=o.attr("data-sizes"),c=o.parent("picture");i.loadImage(o[0],d||l,h,p,!1,(function(){if(null!=i&&i&&(!i||i.params)&&!i.destroyed){if(l?(o.css("background-image",'url("'+l+'")'),o.removeAttr("data-background")):(h&&(o.attr("srcset",h),o.removeAttr("data-srcset")),p&&(o.attr("sizes",p),o.removeAttr("data-sizes")),c.length&&c.children("source").each((function(e,t){var i=n(t);i.attr("data-srcset")&&(i.attr("srcset",i.attr("data-srcset")),i.removeAttr("data-srcset"))})),d&&(o.attr("src",d),o.removeAttr("data-src"))),o.addClass(s.loadedClass).removeClass(s.loadingClass),a.find("."+s.preloaderClass).remove(),i.params.loop&&t){var e=a.attr("data-swiper-slide-index");if(a.hasClass(i.params.slideDuplicateClass)){var r=i.$wrapperEl.children('[data-swiper-slide-index="'+e+'"]:not(.'+i.params.slideDuplicateClass+")");i.lazy.loadInSlide(r.index(),!1)}else{var u=i.$wrapperEl.children("."+i.params.slideDuplicateClass+'[data-swiper-slide-index="'+e+'"]');i.lazy.loadInSlide(u.index(),!1)}}i.emit("lazyImageReady",a[0],o[0]),i.params.autoHeight&&i.updateAutoHeight()}})),i.emit("lazyImageLoad",a[0],o[0])}))}},load:function(){var e=this,t=e.$wrapperEl,i=e.params,s=e.slides,a=e.activeIndex,r=e.virtual&&i.virtual.enabled,o=i.lazy,l=i.slidesPerView;function d(e){if(r){if(t.children("."+i.slideClass+'[data-swiper-slide-index="'+e+'"]').length)return!0}else if(s[e])return!0;return!1}function h(e){return r?n(e).attr("data-swiper-slide-index"):n(e).index()}if("auto"===l&&(l=0),e.lazy.initialImageLoaded||(e.lazy.initialImageLoaded=!0),e.params.watchSlidesVisibility)t.children("."+i.slideVisibleClass).each((function(t,i){var s=r?n(i).attr("data-swiper-slide-index"):n(i).index();e.lazy.loadInSlide(s)}));else if(l>1)for(var p=a;p1||o.loadPrevNextAmount&&o.loadPrevNextAmount>1){for(var c=o.loadPrevNextAmount,u=l,v=Math.min(a+u+Math.max(c,u),s.length),f=Math.max(a-Math.max(u,c),0),m=a+l;m0&&e.lazy.loadInSlide(h(b));var w=t.children("."+i.slidePrevClass);w.length>0&&e.lazy.loadInSlide(h(w))}}},ce={LinearSpline:function(e,t){var i,s,a,r,n,o=function(e,t){for(s=-1,i=e.length;i-s>1;)e[a=i+s>>1]<=t?s=a:i=a;return i};return this.x=e,this.y=t,this.lastIndex=e.length-1,this.interpolate=function(e){return e?(n=o(this.x,e),r=n-1,(e-this.x[r])*(this.y[n]-this.y[r])/(this.x[n]-this.x[r])+this.y[r]):0},this},getInterpolateFunction:function(e){this.controller.spline||(this.controller.spline=this.params.loop?new ce.LinearSpline(this.slidesGrid,e.slidesGrid):new ce.LinearSpline(this.snapGrid,e.snapGrid))},setTranslate:function(e,t){var i,s,a=this,r=a.controller.control;function n(e){var t=a.rtlTranslate?-a.translate:a.translate;"slide"===a.params.controller.by&&(a.controller.getInterpolateFunction(e),s=-a.controller.spline.interpolate(-t)),s&&"container"!==a.params.controller.by||(i=(e.maxTranslate()-e.minTranslate())/(a.maxTranslate()-a.minTranslate()),s=(t-a.minTranslate())*i+e.minTranslate()),a.params.controller.inverse&&(s=e.maxTranslate()-s),e.updateProgress(s),e.setTranslate(s,a),e.updateActiveIndex(),e.updateSlidesClasses()}if(Array.isArray(r))for(var o=0;o0&&(this.isBeginning?(this.a11y.disableEl(i),this.a11y.makeElNotFocusable(i)):(this.a11y.enableEl(i),this.a11y.makeElFocusable(i))),t&&t.length>0&&(this.isEnd?(this.a11y.disableEl(t),this.a11y.makeElNotFocusable(t)):(this.a11y.enableEl(t),this.a11y.makeElFocusable(t)))}},updatePagination:function(){var e=this,t=e.params.a11y;e.pagination&&e.params.pagination.clickable&&e.pagination.bullets&&e.pagination.bullets.length&&e.pagination.bullets.each((function(i,s){var a=n(s);e.a11y.makeElFocusable(a),e.a11y.addElRole(a,"button"),e.a11y.addElLabel(a,t.paginationBulletMessage.replace(/\{\{index\}\}/,a.index()+1))}))},init:function(){this.$el.append(this.a11y.liveRegion);var e,t,i=this.params.a11y;this.navigation&&this.navigation.$nextEl&&(e=this.navigation.$nextEl),this.navigation&&this.navigation.$prevEl&&(t=this.navigation.$prevEl),e&&(this.a11y.makeElFocusable(e),this.a11y.addElRole(e,"button"),this.a11y.addElLabel(e,i.nextSlideMessage),e.on("keydown",this.a11y.onEnterKey)),t&&(this.a11y.makeElFocusable(t),this.a11y.addElRole(t,"button"),this.a11y.addElLabel(t,i.prevSlideMessage),t.on("keydown",this.a11y.onEnterKey)),this.pagination&&this.params.pagination.clickable&&this.pagination.bullets&&this.pagination.bullets.length&&this.pagination.$el.on("keydown","."+this.params.pagination.bulletClass,this.a11y.onEnterKey)},destroy:function(){var e,t;this.a11y.liveRegion&&this.a11y.liveRegion.length>0&&this.a11y.liveRegion.remove(),this.navigation&&this.navigation.$nextEl&&(e=this.navigation.$nextEl),this.navigation&&this.navigation.$prevEl&&(t=this.navigation.$prevEl),e&&e.off("keydown",this.a11y.onEnterKey),t&&t.off("keydown",this.a11y.onEnterKey),this.pagination&&this.params.pagination.clickable&&this.pagination.bullets&&this.pagination.bullets.length&&this.pagination.$el.off("keydown","."+this.params.pagination.bulletClass,this.a11y.onEnterKey)}},ve={init:function(){if(this.params.history){if(!a.history||!a.history.pushState)return this.params.history.enabled=!1,void(this.params.hashNavigation.enabled=!0);var e=this.history;e.initialized=!0,e.paths=ve.getPathValues(),(e.paths.key||e.paths.value)&&(e.scrollToSlide(0,e.paths.value,this.params.runCallbacksOnInit),this.params.history.replaceState||a.addEventListener("popstate",this.history.setHistoryPopState))}},destroy:function(){this.params.history.replaceState||a.removeEventListener("popstate",this.history.setHistoryPopState)},setHistoryPopState:function(){this.history.paths=ve.getPathValues(),this.history.scrollToSlide(this.params.speed,this.history.paths.value,!1)},getPathValues:function(){var e=a.location.pathname.slice(1).split("/").filter((function(e){return""!==e})),t=e.length;return{key:e[t-2],value:e[t-1]}},setHistory:function(e,t){if(this.history.initialized&&this.params.history.enabled){var i=this.slides.eq(t),s=ve.slugify(i.attr("data-history"));a.location.pathname.includes(e)||(s=e+"/"+s);var r=a.history.state;r&&r.value===s||(this.params.history.replaceState?a.history.replaceState({value:s},null,s):a.history.pushState({value:s},null,s))}},slugify:function(e){return e.toString().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},scrollToSlide:function(e,t,i){if(t)for(var s=0,a=this.slides.length;s
'),i.append(e)),e.css({height:a+"px"})):0===(e=t.find(".swiper-cube-shadow")).length&&(e=n('
'),t.append(e)));for(var u=0;u-1&&(c=90*f+90*b,o&&(c=90*-f-90*b)),v.transform(E),d.slideShadows){var T=h?v.find(".swiper-slide-shadow-left"):v.find(".swiper-slide-shadow-top"),S=h?v.find(".swiper-slide-shadow-right"):v.find(".swiper-slide-shadow-bottom");0===T.length&&(T=n('
'),v.append(T)),0===S.length&&(S=n('
'),v.append(S)),T.length&&(T[0].style.opacity=Math.max(-b,0)),S.length&&(S[0].style.opacity=Math.max(b,0))}}if(i.css({"-webkit-transform-origin":"50% 50% -"+l/2+"px","-moz-transform-origin":"50% 50% -"+l/2+"px","-ms-transform-origin":"50% 50% -"+l/2+"px","transform-origin":"50% 50% -"+l/2+"px"}),d.shadow)if(h)e.transform("translate3d(0px, "+(a/2+d.shadowOffset)+"px, "+-a/2+"px) rotateX(90deg) rotateZ(0deg) scale("+d.shadowScale+")");else{var C=Math.abs(c)-90*Math.floor(Math.abs(c)/90),M=1.5-(Math.sin(2*C*Math.PI/360)/2+Math.cos(2*C*Math.PI/360)/2),P=d.shadowScale,z=d.shadowScale/M,k=d.shadowOffset;e.transform("scale3d("+P+", 1, "+z+") translate3d(0px, "+(r/2+k)+"px, "+-r/2/z+"px) rotateX(-90deg)")}var $=_.isSafari||_.isWebView?-l/2:0;i.transform("translate3d(0px,0,"+$+"px) rotateX("+(this.isHorizontal()?0:c)+"deg) rotateY("+(this.isHorizontal()?-c:0)+"deg)")},setTransition:function(e){var t=this.$el;this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),this.params.cubeEffect.shadow&&!this.isHorizontal()&&t.find(".swiper-cube-shadow").transition(e)}},we={setTranslate:function(){for(var e=this.slides,t=this.rtlTranslate,i=0;i
'),s.append(h)),0===p.length&&(p=n('
'),s.append(p)),h.length&&(h[0].style.opacity=Math.max(-a,0)),p.length&&(p[0].style.opacity=Math.max(a,0))}s.transform("translate3d("+l+"px, "+d+"px, 0px) rotateX("+o+"deg) rotateY("+r+"deg)")}},setTransition:function(e){var t=this,i=t.slides,s=t.activeIndex,a=t.$wrapperEl;if(i.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),t.params.virtualTranslate&&0!==e){var r=!1;i.eq(s).transitionEnd((function(){if(!r&&t&&!t.destroyed){r=!0,t.animating=!1;for(var e=["webkitTransitionEnd","transitionend"],i=0;i'),f.append(M)),0===P.length&&(P=n('
'),f.append(P)),M.length&&(M[0].style.opacity=g>0?g:0),P.length&&(P[0].style.opacity=-g>0?-g:0)}}(h.pointerEvents||h.prefixedPointerEvents)&&(s[0].style.perspectiveOrigin=d+"px 50%")},setTransition:function(e){this.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e)}},xe={init:function(){var e=this.params.thumbs,t=this.constructor;e.swiper instanceof t?(this.thumbs.swiper=e.swiper,d.extend(this.thumbs.swiper.originalParams,{watchSlidesProgress:!0,slideToClickedSlide:!1}),d.extend(this.thumbs.swiper.params,{watchSlidesProgress:!0,slideToClickedSlide:!1})):d.isObject(e.swiper)&&(this.thumbs.swiper=new t(d.extend({},e.swiper,{watchSlidesVisibility:!0,watchSlidesProgress:!0,slideToClickedSlide:!1})),this.thumbs.swiperCreated=!0),this.thumbs.swiper.$el.addClass(this.params.thumbs.thumbsContainerClass),this.thumbs.swiper.on("tap",this.thumbs.onThumbClick)},onThumbClick:function(){var e=this.thumbs.swiper;if(e){var t=e.clickedIndex,i=e.clickedSlide;if(!(i&&n(i).hasClass(this.params.thumbs.slideThumbActiveClass)||null==t)){var s;if(s=e.params.loop?parseInt(n(e.clickedSlide).attr("data-swiper-slide-index"),10):t,this.params.loop){var a=this.activeIndex;this.slides.eq(a).hasClass(this.params.slideDuplicateClass)&&(this.loopFix(),this._clientLeft=this.$wrapperEl[0].clientLeft,a=this.activeIndex);var r=this.slides.eq(a).prevAll('[data-swiper-slide-index="'+s+'"]').eq(0).index(),o=this.slides.eq(a).nextAll('[data-swiper-slide-index="'+s+'"]').eq(0).index();s=void 0===r?o:void 0===o?r:o-athis.previousIndex?"next":"prev"}else n=(r=this.realIndex)>this.previousIndex?"next":"prev";a&&(r+="next"===n?s:-1*s),t.visibleSlidesIndexes&&t.visibleSlidesIndexes.indexOf(r)<0&&(t.params.centeredSlides?r=r>o?r-Math.floor(i/2)+1:r+Math.floor(i/2)-1:r>o&&(r=r-i+1),t.slideTo(r,e?0:void 0))}var h=1,p=this.params.thumbs.slideThumbActiveClass;if(this.params.slidesPerView>1&&!this.params.centeredSlides&&(h=this.params.slidesPerView),this.params.thumbs.multipleActiveThumbs||(h=1),h=Math.floor(h),t.slides.removeClass(p),t.params.loop||t.params.virtual&&t.params.virtual.enabled)for(var c=0;c0&&!n(e.target).hasClass(this.params.pagination.bulletClass)&&(!0===this.pagination.$el.hasClass(this.params.pagination.hiddenClass)?this.emit("paginationShow",this):this.emit("paginationHide",this),this.pagination.$el.toggleClass(this.params.pagination.hiddenClass))}}},{name:"scrollbar",params:{scrollbar:{el:null,dragSize:"auto",hide:!1,draggable:!1,snapOnRelease:!0,lockClass:"swiper-scrollbar-lock",dragClass:"swiper-scrollbar-drag"}},create:function(){d.extend(this,{scrollbar:{init:le.init.bind(this),destroy:le.destroy.bind(this),updateSize:le.updateSize.bind(this),setTranslate:le.setTranslate.bind(this),setTransition:le.setTransition.bind(this),enableDraggable:le.enableDraggable.bind(this),disableDraggable:le.disableDraggable.bind(this),setDragPosition:le.setDragPosition.bind(this),getPointerPosition:le.getPointerPosition.bind(this),onDragStart:le.onDragStart.bind(this),onDragMove:le.onDragMove.bind(this),onDragEnd:le.onDragEnd.bind(this),isTouched:!1,timeout:null,dragTimeout:null}})},on:{init:function(){this.scrollbar.init(),this.scrollbar.updateSize(),this.scrollbar.setTranslate()},update:function(){this.scrollbar.updateSize()},resize:function(){this.scrollbar.updateSize()},observerUpdate:function(){this.scrollbar.updateSize()},setTranslate:function(){this.scrollbar.setTranslate()},setTransition:function(e){this.scrollbar.setTransition(e)},destroy:function(){this.scrollbar.destroy()}}},{name:"parallax",params:{parallax:{enabled:!1}},create:function(){d.extend(this,{parallax:{setTransform:de.setTransform.bind(this),setTranslate:de.setTranslate.bind(this),setTransition:de.setTransition.bind(this)}})},on:{beforeInit:function(){this.params.parallax.enabled&&(this.params.watchSlidesProgress=!0,this.originalParams.watchSlidesProgress=!0)},init:function(){this.params.parallax.enabled&&this.parallax.setTranslate()},setTranslate:function(){this.params.parallax.enabled&&this.parallax.setTranslate()},setTransition:function(e){this.params.parallax.enabled&&this.parallax.setTransition(e)}}},{name:"zoom",params:{zoom:{enabled:!1,maxRatio:3,minRatio:1,toggle:!0,containerClass:"swiper-zoom-container",zoomedSlideClass:"swiper-slide-zoomed"}},create:function(){var e=this,t={enabled:!1,scale:1,currentScale:1,isScaling:!1,gesture:{$slideEl:void 0,slideWidth:void 0,slideHeight:void 0,$imageEl:void 0,$imageWrapEl:void 0,maxRatio:3},image:{isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},velocity:{x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0}};"onGestureStart onGestureChange onGestureEnd onTouchStart onTouchMove onTouchEnd onTransitionEnd toggle enable disable in out".split(" ").forEach((function(i){t[i]=he[i].bind(e)})),d.extend(e,{zoom:t});var i=1;Object.defineProperty(e.zoom,"scale",{get:function(){return i},set:function(t){if(i!==t){var s=e.zoom.gesture.$imageEl?e.zoom.gesture.$imageEl[0]:void 0,a=e.zoom.gesture.$slideEl?e.zoom.gesture.$slideEl[0]:void 0;e.emit("zoomChange",t,s,a)}i=t}})},on:{init:function(){this.params.zoom.enabled&&this.zoom.enable()},destroy:function(){this.zoom.disable()},touchStart:function(e){this.zoom.enabled&&this.zoom.onTouchStart(e)},touchEnd:function(e){this.zoom.enabled&&this.zoom.onTouchEnd(e)},doubleTap:function(e){this.params.zoom.enabled&&this.zoom.enabled&&this.params.zoom.toggle&&this.zoom.toggle(e)},transitionEnd:function(){this.zoom.enabled&&this.params.zoom.enabled&&this.zoom.onTransitionEnd()},slideChange:function(){this.zoom.enabled&&this.params.zoom.enabled&&this.params.cssMode&&this.zoom.onTransitionEnd()}}},{name:"lazy",params:{lazy:{enabled:!1,loadPrevNext:!1,loadPrevNextAmount:1,loadOnTransitionStart:!1,elementClass:"swiper-lazy",loadingClass:"swiper-lazy-loading",loadedClass:"swiper-lazy-loaded",preloaderClass:"swiper-lazy-preloader"}},create:function(){d.extend(this,{lazy:{initialImageLoaded:!1,load:pe.load.bind(this),loadInSlide:pe.loadInSlide.bind(this)}})},on:{beforeInit:function(){this.params.lazy.enabled&&this.params.preloadImages&&(this.params.preloadImages=!1)},init:function(){this.params.lazy.enabled&&!this.params.loop&&0===this.params.initialSlide&&this.lazy.load()},scroll:function(){this.params.freeMode&&!this.params.freeModeSticky&&this.lazy.load()},resize:function(){this.params.lazy.enabled&&this.lazy.load()},scrollbarDragMove:function(){this.params.lazy.enabled&&this.lazy.load()},transitionStart:function(){this.params.lazy.enabled&&(this.params.lazy.loadOnTransitionStart||!this.params.lazy.loadOnTransitionStart&&!this.lazy.initialImageLoaded)&&this.lazy.load()},transitionEnd:function(){this.params.lazy.enabled&&!this.params.lazy.loadOnTransitionStart&&this.lazy.load()},slideChange:function(){this.params.lazy.enabled&&this.params.cssMode&&this.lazy.load()}}},{name:"controller",params:{controller:{control:void 0,inverse:!1,by:"slide"}},create:function(){d.extend(this,{controller:{control:this.params.controller.control,getInterpolateFunction:ce.getInterpolateFunction.bind(this),setTranslate:ce.setTranslate.bind(this),setTransition:ce.setTransition.bind(this)}})},on:{update:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},resize:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},observerUpdate:function(){this.controller.control&&this.controller.spline&&(this.controller.spline=void 0,delete this.controller.spline)},setTranslate:function(e,t){this.controller.control&&this.controller.setTranslate(e,t)},setTransition:function(e,t){this.controller.control&&this.controller.setTransition(e,t)}}},{name:"a11y",params:{a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}"}},create:function(){var e=this;d.extend(e,{a11y:{liveRegion:n('')}}),Object.keys(ue).forEach((function(t){e.a11y[t]=ue[t].bind(e)}))},on:{init:function(){this.params.a11y.enabled&&(this.a11y.init(),this.a11y.updateNavigation())},toEdge:function(){this.params.a11y.enabled&&this.a11y.updateNavigation()},fromEdge:function(){this.params.a11y.enabled&&this.a11y.updateNavigation()},paginationUpdate:function(){this.params.a11y.enabled&&this.a11y.updatePagination()},destroy:function(){this.params.a11y.enabled&&this.a11y.destroy()}}},{name:"history",params:{history:{enabled:!1,replaceState:!1,key:"slides"}},create:function(){d.extend(this,{history:{init:ve.init.bind(this),setHistory:ve.setHistory.bind(this),setHistoryPopState:ve.setHistoryPopState.bind(this),scrollToSlide:ve.scrollToSlide.bind(this),destroy:ve.destroy.bind(this)}})},on:{init:function(){this.params.history.enabled&&this.history.init()},destroy:function(){this.params.history.enabled&&this.history.destroy()},transitionEnd:function(){this.history.initialized&&this.history.setHistory(this.params.history.key,this.activeIndex)},slideChange:function(){this.history.initialized&&this.params.cssMode&&this.history.setHistory(this.params.history.key,this.activeIndex)}}},{name:"hash-navigation",params:{hashNavigation:{enabled:!1,replaceState:!1,watchState:!1}},create:function(){d.extend(this,{hashNavigation:{initialized:!1,init:fe.init.bind(this),destroy:fe.destroy.bind(this),setHash:fe.setHash.bind(this),onHashCange:fe.onHashCange.bind(this)}})},on:{init:function(){this.params.hashNavigation.enabled&&this.hashNavigation.init()},destroy:function(){this.params.hashNavigation.enabled&&this.hashNavigation.destroy()},transitionEnd:function(){this.hashNavigation.initialized&&this.hashNavigation.setHash()},slideChange:function(){this.hashNavigation.initialized&&this.params.cssMode&&this.hashNavigation.setHash()}}},{name:"autoplay",params:{autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!0,stopOnLastSlide:!1,reverseDirection:!1}},create:function(){var e=this;d.extend(e,{autoplay:{running:!1,paused:!1,run:me.run.bind(e),start:me.start.bind(e),stop:me.stop.bind(e),pause:me.pause.bind(e),onVisibilityChange:function(){"hidden"===document.visibilityState&&e.autoplay.running&&e.autoplay.pause(),"visible"===document.visibilityState&&e.autoplay.paused&&(e.autoplay.run(),e.autoplay.paused=!1)},onTransitionEnd:function(t){e&&!e.destroyed&&e.$wrapperEl&&t.target===this&&(e.$wrapperEl[0].removeEventListener("transitionend",e.autoplay.onTransitionEnd),e.$wrapperEl[0].removeEventListener("webkitTransitionEnd",e.autoplay.onTransitionEnd),e.autoplay.paused=!1,e.autoplay.running?e.autoplay.run():e.autoplay.stop())}}})},on:{init:function(){this.params.autoplay.enabled&&(this.autoplay.start(),document.addEventListener("visibilitychange",this.autoplay.onVisibilityChange))},beforeTransitionStart:function(e,t){this.autoplay.running&&(t||!this.params.autoplay.disableOnInteraction?this.autoplay.pause(e):this.autoplay.stop())},sliderFirstMove:function(){this.autoplay.running&&(this.params.autoplay.disableOnInteraction?this.autoplay.stop():this.autoplay.pause())},touchEnd:function(){this.params.cssMode&&this.autoplay.paused&&!this.params.autoplay.disableOnInteraction&&this.autoplay.run()},destroy:function(){this.autoplay.running&&this.autoplay.stop(),document.removeEventListener("visibilitychange",this.autoplay.onVisibilityChange)}}},{name:"effect-fade",params:{fadeEffect:{crossFade:!1}},create:function(){d.extend(this,{fadeEffect:{setTranslate:ge.setTranslate.bind(this),setTransition:ge.setTransition.bind(this)}})},on:{beforeInit:function(){if("fade"===this.params.effect){this.classNames.push(this.params.containerModifierClass+"fade");var e={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0};d.extend(this.params,e),d.extend(this.originalParams,e)}},setTranslate:function(){"fade"===this.params.effect&&this.fadeEffect.setTranslate()},setTransition:function(e){"fade"===this.params.effect&&this.fadeEffect.setTransition(e)}}},{name:"effect-cube",params:{cubeEffect:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94}},create:function(){d.extend(this,{cubeEffect:{setTranslate:be.setTranslate.bind(this),setTransition:be.setTransition.bind(this)}})},on:{beforeInit:function(){if("cube"===this.params.effect){this.classNames.push(this.params.containerModifierClass+"cube"),this.classNames.push(this.params.containerModifierClass+"3d");var e={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,resistanceRatio:0,spaceBetween:0,centeredSlides:!1,virtualTranslate:!0};d.extend(this.params,e),d.extend(this.originalParams,e)}},setTranslate:function(){"cube"===this.params.effect&&this.cubeEffect.setTranslate()},setTransition:function(e){"cube"===this.params.effect&&this.cubeEffect.setTransition(e)}}},{name:"effect-flip",params:{flipEffect:{slideShadows:!0,limitRotation:!0}},create:function(){d.extend(this,{flipEffect:{setTranslate:we.setTranslate.bind(this),setTransition:we.setTransition.bind(this)}})},on:{beforeInit:function(){if("flip"===this.params.effect){this.classNames.push(this.params.containerModifierClass+"flip"),this.classNames.push(this.params.containerModifierClass+"3d");var e={slidesPerView:1,slidesPerColumn:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!0};d.extend(this.params,e),d.extend(this.originalParams,e)}},setTranslate:function(){"flip"===this.params.effect&&this.flipEffect.setTranslate()},setTransition:function(e){"flip"===this.params.effect&&this.flipEffect.setTransition(e)}}},{name:"effect-coverflow",params:{coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}},create:function(){d.extend(this,{coverflowEffect:{setTranslate:ye.setTranslate.bind(this),setTransition:ye.setTransition.bind(this)}})},on:{beforeInit:function(){"coverflow"===this.params.effect&&(this.classNames.push(this.params.containerModifierClass+"coverflow"),this.classNames.push(this.params.containerModifierClass+"3d"),this.params.watchSlidesProgress=!0,this.originalParams.watchSlidesProgress=!0)},setTranslate:function(){"coverflow"===this.params.effect&&this.coverflowEffect.setTranslate()},setTransition:function(e){"coverflow"===this.params.effect&&this.coverflowEffect.setTransition(e)}}},{name:"thumbs",params:{thumbs:{swiper:null,multipleActiveThumbs:!0,autoScrollOffset:0,slideThumbActiveClass:"swiper-slide-thumb-active",thumbsContainerClass:"swiper-container-thumbs"}},create:function(){d.extend(this,{thumbs:{swiper:null,init:xe.init.bind(this),update:xe.update.bind(this),onThumbClick:xe.onThumbClick.bind(this)}})},on:{beforeInit:function(){var e=this.params.thumbs;e&&e.swiper&&(this.thumbs.init(),this.thumbs.update(!0))},slideChange:function(){this.thumbs.swiper&&this.thumbs.update()},update:function(){this.thumbs.swiper&&this.thumbs.update()},resize:function(){this.thumbs.swiper&&this.thumbs.update()},observerUpdate:function(){this.thumbs.swiper&&this.thumbs.update()},setTransition:function(e){var t=this.thumbs.swiper;t&&t.setTransition(e)},beforeDestroy:function(){var e=this.thumbs.swiper;e&&this.thumbs.swiperCreated&&e&&e.destroy()}}}];return void 0===j.use&&(j.use=j.Class.use,j.installModule=j.Class.installModule),j.use(Ee),j})); !function(){var t=!1,i=Math.PI/2-.4,s=Math.PI/2+.4,e={x:0,y:0,block:!1};jQuery("rs-slide[data-revaddonpaintbrush]").each((function(){var t=jQuery(this),i=t.children("img"),s=i.attr("data-bg"),e="";s&&(s=s.split("c:")).length>1&&(e=s[1].split(";")[0]);var a="p:center center;";e&&(a+="c:"+e+";"),i.attr({"data-bg":a,"data-kenburns":"off"}).removeAttr("data-panzoom"),t.attr("data-revaddonpaintbrushedges")&&t.attr("data-anim","ei:d;eo:d;s:1000;r:0;t:fade;sl:0;")})),jQuery("rs-slide[data-revaddonpaintbrushfallback]").each((function(){var t=jQuery(this),i=t.children("img"),s=t.attr("data-revaddonpaintbrushfallback"),e=i.attr("data-lazyload"),a=e?"data-lazyload":"src";e?i.data("lazyload",s):i.attr(a,s)}));var a,n="ontouchend"in document;function h(i,s,e,a,n,h,r,o,d,c){if(this.pause=!0,this.options=s,this.slide=e,this.img=a,this.slot=n,this.levels=h,this.widths=r,this.slider=i,this.fixEdges=o,this.edgeFix=d,this.frame=void 0,t&&(this.options.shadowBlur/=2),c){var l=document.createElement("style");l.type="text/css",document.head.appendChild(l),this.blurstyle={sheet:l,css:"."+c+" rs-sbg, ."+c+" .slot {filter: blur({{blur}}px);}"},this.resizeBlur(),i.on("revolution.slide.afterdraw",this.blurSizer.bind(this))}}window.RevSliderPaintBrush=function(i,s){if(a=i){var e=!(!a.fn.revolution||!a.fn.revolution[s[0].id])&&a.fn.revolution[s[0].id];e&&(t=a.fn.revolution.isFirefox(),s.on("revolution.slide.onloaded",(function(){var t="",i=e.responsiveLevels,n=e.gridwidth;if(Array.isArray(i)||(i=[i]),Array.isArray(n)||(n=[n]),s.find("rs-slide[data-revaddonpaintbrush]").each((function(){var e,r,o,d,c=new Image,l=a(this).addClass("revaddon-paintbrush").data("paintbrushloading",!0),u=l.attr("data-key"),v=l.find("rs-sbg-wrap"),p=JSON.parse(this.getAttribute("data-revaddonpaintbrush"));(p=a.extend(!0,{blurAmount:10,fadetime:1e3,edgefix:10,fixedges:!1,style:"round",blur:!1,scaleblur:!1,responsive:!1,disappear:!1,carousel:!1},p)).blur&&(e="revaddonblurfilter_"+u,p.scaleblur?d=e:t+="."+e+" rs-sbg, ."+e+" .slot {filter: blur("+p.blurAmount+"px);}",l.addClass(e)),p.fixedges&&p.edgefix&&(r=1+.01*p.edgefix,o="scale("+(o=r.toFixed(2))+", "+o+")",v.find("rs-sbg").css("transform",o),t+="."+(e="revaddonblurfilterfix_"+u)+" rs-sbg {transform: "+o+" !important}",l.addClass(e)),c.onload=function(){p.width=this.naturalWidth,p.height=this.naturalHeight;var t=new h(s,p,l,c,v[0],i,n,o,r,d);l.removeData("paintbrushloading").data("revaddonbrush",t),l.data("paintbrushcurrent")&&(t.pause=!1,l.removeData("paintbrushcurrent"),t.inited||t.init())},c.onerror=function(){console.log("PaintBrush Addon: background image could not be loaded")},c.src=p.image})),t){var r=document.createElement("style");r.type="text/css",r.innerHTML=t,document.head.appendChild(r)}})).on("revolution.slide.onbeforeswap",(function(t,i){i.currentslide.removeData("paintbrushcurrent");var s=i.currentslide.data("revaddonbrush");s&&s.canvas&&(s.canvas.className="revaddonpaintbrush swapping")})).on("revolution.slide.onafterswap",(function(t,i){var e;s.find(".revaddon-paintbrush").each((function(){(e=a(this).removeData("paintbrushcurrent").data("revaddonbrush"))&&(e.pause=!0,e.reset(),e.canvas&&(e.canvas.className="revaddonpaintbrush"))}));var n=s.revcurrentslide()-1,h=s.find("rs-slide").eq(n);h.length||(h=s.find("rs-slide").eq(0)),(e=h.data("revaddonbrush"))?(e.pause=!1,e.ready=!0,e.inited||e.init()):h.data("paintbrushloading")&&h.data("paintbrushcurrent",!0)})))}},h.prototype={init:function(){this.canvas=document.createElement("canvas"),this.brush=document.createElement("canvas"),this.canvas.className="revaddonpaintbrush",this.context=this.canvas.getContext("2d"),this.ctx=this.brush.getContext("2d"),this.slot.parentNode.insertBefore(this.canvas,this.slot.nextSibling),this.inited=!0,this.steps=[],this.options.carousel?setTimeout(this.start.bind(this),100):this.start()},start:function(){this.options.carousel?(this.slide.on("touchstart",this.onTouchStart.bind(this)),this.slide.on("mousemove touchmove",this.onMove.bind(this))):(this.slider.on("touchstart",this.onTouchStart.bind(this)),this.slider.on("mousemove touchmove",this.onMove.bind(this))),this.slider.on("revolution.slide.afterdraw",this.sizer.bind(this)),this.resize()},onTouchStart:function(t){n&&((t=t.originalEvent).touches&&(t=t.touches[0]),function(t){e.x=t.clientX,e.y=t.clientY,e.block=!1}(t))},onMove:function(t){if(!this.pause&&"no"!==e.block){if(n){var a=t;if((t=t.originalEvent).touches&&(t=t.touches[0]),e.block||function(t){var a=e.x-t.clientX,n=e.y-t.clientY,h=Math.abs(Math.atan2(n,a));e.block=h>i&&hthis.options.fade&&(this.steps.length=i)},paint:function(){for(var t,i,s=this.steps.length,e=Date.now(),a=1;a1&&(this.frame=window.requestAnimationFrame(this.draw.bind(this))),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.disappear&&this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.paint(),this.context.globalCompositeOperation="source-over",this.context.drawImage(this.img,this.cx,this.cy,this.cw,this.ch,0,0,this.canvas.width,this.canvas.height),this.context.shadowBlur=this.options.strength,this.context.globalCompositeOperation="destination-in",this.context.drawImage(this.brush,0,0),this.context.shadowBlur=0},reset:function(){this.context&&(this.frame=cancelAnimationFrame(this.frame),this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height))},sizer:function(){this.options.carousel?(clearTimeout(this.timer),this.timer=setTimeout(this.resize.bind(this),250)):this.resize()},resize:function(t){t||this.reset();var i=this.slide.width(),s=this.slide.height();this.edgeFix&&(i*=this.edgeFix,s*=this.edgeFix);var e=Math.min(i/this.options.width,s/this.options.height);if(t)return e;var a=this.options.width*e,n=this.options.height*e,h=1;a', '
' ); } elementor.promotion.showDialog({ title: sprintf( wp.i18n.__('%s Widget', 'qi-addons-for-elementor' ), title ), content: content, position: { blockStart: '-7' }, targetElement: this.el, actionButton: { url: actionURL, text: promotion.action_button.text, classes: promotion.action_button.classes||['elementor-button', 'go-pro'] }} ); }}; panel.elements.view=elementsView.extend({ childView: elementsView.prototype.childView.extend(qodeWidgetsPromoHandler) } ); panel.categories.view=categoriesView.extend({ childView: categoriesView.prototype.childView.extend({ childView: categoriesView.prototype.childView.prototype.childView.extend(qodeWidgetsPromoHandler) } ) } ); return panel; } ); }}, };})(jQuery); (function ($){ const wdtSectionsOptionsHandler=function($scope){ const animationEffectInstance=new wdtWidgetsAnimationEffectHandlerInit($scope); animationEffectInstance.init(); }; const wdtWidgetsAnimationEffectHandlerInit=function($scope){ const $self=this, $window=$(window), $sectionId=$scope.data('id'), $editMode=Boolean(elementorFrontend.isEditMode()), $activeBreakpoints=elementorFrontend.config.responsive.activeBreakpoints, $deviceMode=elementorFrontend.getCurrentDeviceMode(); let $activeBreakpointkeys=[]; let $animationEffectSettings=false; let $mouseMoveItemSettings={}; let $scrollItemSettings={}; $self.init=function(){ $self.animationEffectInit(); }; $self.filterObjects=function($settings, $searchKey){ let $settingKeys=Object.keys($settings).filter((key)=> key.includes($searchKey)); let $filteredSettings=$settingKeys.reduce((cur, key)=> { return Object.assign(cur, { [key]: $settings[key] })}, {}); if(Object.keys($filteredSettings).length){ return $filteredSettings; } return false; }; $self.animationEffectInit=function(){ if($editMode){ $animationEffectSettings=$self.generateEditorSettings($sectionId); }else{ $animationEffectSettings=$scope.data('settings')||false; $animationEffectSettings=$self.filterObjects($animationEffectSettings, 'wdt_'); } if(!$animationEffectSettings||$animationEffectSettings['wdt_animation_effect']==='none'||$animationEffectSettings['wdt_animation_effect']===''){ return false; } $self.updateActiveBreakpoints(); $self.generateBgItemsInSections(); if(Object.keys($mouseMoveItemSettings).length){ $self.animationEffectMouseMove(); } if(Object.keys($scrollItemSettings).length){ let img=new Image(); if($animationEffectSettings['wdt_bg_image']['url']!==''){ img.src=$animationEffectSettings['wdt_bg_image']['url']; img.onload=function(){ let $bgCSS={ 'height': this.height+'px' }; $scope.find('.wdt-section-bgeffects-image').css($bgCSS); $self.animationEffectScroll(); }} }}; $self.generateEditorSettings=function($sectionId){ let $editorModels=null, $editorSettings={}; if(!window.elementor.hasOwnProperty('elements')){ return false; } $editorModels=window.elementor.elements.models; if(!$editorModels){ return false; } $.each($editorModels, function(index, obj){ if($sectionId===obj.id){ $editorSettings=obj.attributes.settings.attributes; }}); if(!Object.keys($editorSettings).length){ return false; } return $self.filterObjects($editorSettings, 'wdt_'); }; $self.updateActiveBreakpoints=function(){ $.each($activeBreakpoints, function (key, value){ if('widescreen'===key){ $activeBreakpointkeys.push('desktop'); $activeBreakpointkeys.push(key); }else{ $activeBreakpointkeys.push(key); }}); if(-1===$activeBreakpointkeys.indexOf('widescreen')){ $activeBreakpointkeys.push('desktop'); }}; $self.generateBreakpointwiseBgItems=function($section){ let $bgItems={}; let $wdt_bg_image=($section['wdt_bg_image']&&''!=$section['wdt_bg_image']['url']) ? $section['wdt_bg_image']['url']:''; let $wdt_bg_position=($section['wdt_bg_position']&&''!=$section['wdt_bg_position']) ? $section['wdt_bg_position']:'center center'; let $wdt_bg_size=($section['wdt_bg_size']&&''!=$section['wdt_bg_size']) ? $section['wdt_bg_size']:''; $activeBreakpointkeys.forEach(function(breakpoint){ if('desktop'===breakpoint){ $bgItems[breakpoint]={ 'bgImage':$wdt_bg_image, 'bgPosition':$wdt_bg_position, 'bgSize':$wdt_bg_size };}else{ $bgItems[breakpoint]={ 'bgImage':($section['wdt_bg_image_' + breakpoint]&&''!=$section['wdt_bg_image_' + breakpoint]['url']) ? $section['wdt_bg_image_' + breakpoint]['url']:$wdt_bg_image, 'bgPosition':($section['wdt_bg_position_' + breakpoint]&&''!=$section['wdt_bg_position_' + breakpoint]) ? $section['wdt_bg_position_' + breakpoint]:$wdt_bg_position, 'bgSize':($section['wdt_bg_size_' + breakpoint]&&''!=$section['wdt_bg_size_' + breakpoint]) ? $section['wdt_bg_size_' + breakpoint]:$wdt_bg_size };}}); return $bgItems; }; $self.generateBgItemsInSections=function(){ $('.wdt-section-bgeffects-item', $scope).remove(); const $effectType=$animationEffectSettings['wdt_animation_effect']; let $bgItem=$self.generateBreakpointwiseBgItems($animationEffectSettings); if($effectType==='none'||$effectType===''||!$bgItem[$deviceMode]){ return false; } if(!$scope.hasClass('wdt-section-bgeffects')){ $scope.addClass('wdt-section-bgeffects'); } const $bgImage=$bgItem[$deviceMode].bgImage; const $bgPosition=$bgItem[$deviceMode].bgPosition; const $bgSize=$bgItem[$deviceMode].bgSize; if($effectType==='mouse-move'){ let $layout=$('
').prependTo($scope); $mouseMoveItemSettings=$self.filterObjects($animationEffectSettings, 'wdt_mme_'); $mouseMoveItemSettings['wdt_item']=$layout; }else if($effectType==='scroll'){ let $layout=$('
').prependTo($scope); let $bgCSS={ 'background-image': 'url(' + $bgImage + ')', 'background-position': $bgPosition, 'background-repeat': 'no-repeat', 'background-size': $bgSize }; $('> .wdt-section-bgeffects-image', $layout).css($bgCSS); $scrollItemSettings=$self.filterObjects($animationEffectSettings, 'wdt_sle_'); $scrollItemSettings['wdt_item']=$layout; }}; $self.getMouseMoveResponsiveSettings=function($mouseMoveItem){ let $mouseMoveBreakpointItem={}; $activeBreakpointkeys.forEach(function($breakpoint){ if('desktop'===$breakpoint){ $mouseMoveBreakpointItem[$breakpoint]={ 'speed':($mouseMoveItem['wdt_mme_speed']['size']&&''!=$mouseMoveItem['wdt_mme_speed']['size']) ? $mouseMoveItem['wdt_mme_speed']['size']:0.1, 'depth':($mouseMoveItem['wdt_mme_depth']['size']&&''!=$mouseMoveItem['wdt_mme_depth']['size']) ? $mouseMoveItem['wdt_mme_depth']['size']:1 };}else{ $mouseMoveBreakpointItem[$breakpoint]={ 'speed':($mouseMoveItem['wdt_mme_speed_' + $breakpoint]['size']&&''!=$mouseMoveItem['wdt_mme_speed_' + $breakpoint]['size']) ? $mouseMoveItem['wdt_mme_speed_' + $breakpoint]['size']:$mouseMoveItem['wdt_mme_speed']['size'], 'depth':($mouseMoveItem['wdt_mme_depth_' + $breakpoint]['size']&&''!=$mouseMoveItem['wdt_mme_depth_' + $breakpoint]['size']) ? $mouseMoveItem['wdt_mme_depth_' + $breakpoint]['size']:$mouseMoveItem['wdt_mme_depth']['size'] };}}); return $mouseMoveBreakpointItem; }; $self.animationEffectMouseMove=function(){ let $mouseMoveBreakpointwiseItem=$self.getMouseMoveResponsiveSettings($mouseMoveItemSettings); if(!$mouseMoveBreakpointwiseItem[$deviceMode]){ return false; } const $speed=$mouseMoveBreakpointwiseItem[$deviceMode].speed; const $depth=$mouseMoveBreakpointwiseItem[$deviceMode].depth; const $moveAlong=$mouseMoveItemSettings['wdt_mme_move_along'] ? $mouseMoveItemSettings['wdt_mme_move_along']:'both'; const $invertMovement=$mouseMoveItemSettings['wdt_mme_invert_movement'] ? Boolean($mouseMoveItemSettings['wdt_mme_invert_movement']):false; let $options={}; $scope.find('.wdt-effect-mouse-move-wrapper').attr('data-depth', $depth); if($moveAlong==='x-axis'){ $options['scalarX']=10.0; $options['scalarY']=0.0; } if($moveAlong==='y-axis'){ $options['scalarX']=0.0; $options['scalarY']=10.0; } if($moveAlong==='both'){ $options['scalarX']=10.0; $options['scalarY']=10.0; } $options['frictionX']=$speed; $options['frictionY']=$speed; $options['invertX']=$invertMovement; $options['invertY']=$invertMovement; $parallaxInstance=$scope.parallax($options); }; $self.getScrollResponsiveSettings=function($scrollItem){ let $scrollBreakpointItem={}; let $wdt_sle_parallax_x_depth=($scrollItem['wdt_sle_parallax_x_depth']&&''!=$scrollItem['wdt_sle_parallax_x_depth']['size']) ? $scrollItem['wdt_sle_parallax_x_depth']['size']:50; let $wdt_sle_parallax_y_depth=($scrollItem['wdt_sle_parallax_y_depth']&&''!=$scrollItem['wdt_sle_parallax_y_depth']['size']) ? $scrollItem['wdt_sle_parallax_y_depth']['size']:50; let $wdt_sle_rotate_x_angle=($scrollItem['wdt_sle_rotate_x_angle']&&''!=$scrollItem['wdt_sle_rotate_x_angle']['size']) ? $scrollItem['wdt_sle_rotate_x_angle']['size']:45; let $wdt_sle_rotate_y_angle=($scrollItem['wdt_sle_rotate_y_angle']&&''!=$scrollItem['wdt_sle_rotate_y_angle']['size']) ? $scrollItem['wdt_sle_rotate_y_angle']['size']:45; let $wdt_sle_rotate_z_angle=($scrollItem['wdt_sle_rotate_z_angle']&&''!=$scrollItem['wdt_sle_rotate_z_angle']['size']) ? $scrollItem['wdt_sle_rotate_z_angle']['size']:45; let $wdt_sle_scale_value=($scrollItem['wdt_sle_scale_value']&&''!=$scrollItem['wdt_sle_scale_value']['size']) ? $scrollItem['wdt_sle_scale_value']['size']:1; let $wdt_sle_blur_value=($scrollItem['wdt_sle_blur_value']&&''!=$scrollItem['wdt_sle_blur_value']['size']) ? $scrollItem['wdt_sle_blur_value']['size']:0; let $wdt_sle_opacity_value=($scrollItem['wdt_sle_opacity_value']&&''!=$scrollItem['wdt_sle_opacity_value']['size']) ? $scrollItem['wdt_sle_opacity_value']['size']:1; $activeBreakpointkeys.forEach(function($breakpoint){ if('desktop'===$breakpoint){ $scrollBreakpointItem[$breakpoint]={ 'parallaxDepthX': $wdt_sle_parallax_x_depth, 'parallaxDepthY': $wdt_sle_parallax_y_depth, 'rotateAngleX':$wdt_sle_rotate_x_angle, 'rotateAngleY':$wdt_sle_rotate_y_angle, 'rotateAngleZ':$wdt_sle_rotate_z_angle, 'scaleValue':$wdt_sle_scale_value, 'blurValue':$wdt_sle_blur_value, 'opacityValue':$wdt_sle_opacity_value };}else{ $scrollBreakpointItem[$breakpoint]={ 'parallaxDepthX':($scrollItem['wdt_sle_parallax_x_depth_' + $breakpoint]&&''!=$scrollItem['wdt_sle_parallax_x_depth_' + $breakpoint]['size']) ? $scrollItem['wdt_sle_parallax_x_depth_' + $breakpoint]['size']:$wdt_sle_parallax_x_depth, 'parallaxDepthY':($scrollItem['wdt_sle_parallax_y_depth_' + $breakpoint]&&''!=$scrollItem['wdt_sle_parallax_y_depth_' + $breakpoint]['size']) ? $scrollItem['wdt_sle_parallax_y_depth_' + $breakpoint]['size']:$wdt_sle_parallax_y_depth, 'rotateAngleX':($scrollItem['wdt_sle_rotate_x_angle_' + $breakpoint]&&''!=$scrollItem['wdt_sle_rotate_x_angle_' + $breakpoint]['size']) ? $scrollItem['wdt_sle_rotate_x_angle_' + $breakpoint]['size']:$wdt_sle_rotate_x_angle, 'rotateAngleY':($scrollItem['wdt_sle_rotate_y_angle_' + $breakpoint]&&''!=$scrollItem['wdt_sle_rotate_y_angle_' + $breakpoint]['size']) ? $scrollItem['wdt_sle_rotate_y_angle_' + $breakpoint]['size']:$wdt_sle_rotate_y_angle, 'rotateAngleZ':($scrollItem['wdt_sle_rotate_z_angle_' + $breakpoint]&&''!=$scrollItem['wdt_sle_rotate_z_angle_' + $breakpoint]['size']) ? $scrollItem['wdt_sle_rotate_z_angle_' + $breakpoint]['size']:$wdt_sle_rotate_z_angle, 'scaleValue':($scrollItem['wdt_sle_scale_value_' + $breakpoint]&&''!=$scrollItem['wdt_sle_scale_value_' + $breakpoint]['size']) ? $scrollItem['wdt_sle_scale_value_' + $breakpoint]['size']:$wdt_sle_scale_value, 'blurValue':($scrollItem['wdt_sle_blur_value_' + $breakpoint]&&''!=$scrollItem['wdt_sle_blur_value_' + $breakpoint]['size']) ? $scrollItem['wdt_sle_blur_value_' + $breakpoint]['size']:$wdt_sle_blur_value, 'opacityValue':($scrollItem['wdt_sle_opacity_value' + $breakpoint]&&''!=$scrollItem['wdt_sle_opacity_value' + $breakpoint]['size']) ? $scrollItem['wdt_sle_opacity_value' + $breakpoint]['size']:$wdt_sle_opacity_value, };}}); return $scrollBreakpointItem; }; $self.animationEffectScroll=function(){ let $scrollBreakpointwiseItem=$self.getScrollResponsiveSettings($scrollItemSettings); if(!$scrollBreakpointwiseItem[$deviceMode]){ return false; } const $parallaxDirectionX=$scrollItemSettings['wdt_sle_parallax_x_direction'] ? Boolean($scrollItemSettings['wdt_sle_parallax_x_direction']):false; const $parallaxDepthX=$scrollBreakpointwiseItem[$deviceMode].parallaxDepthX; const $parallaxDirectionY=$scrollItemSettings['wdt_sle_parallax_y_direction'] ? Boolean($scrollItemSettings['wdt_sle_parallax_y_direction']):false; const $parallaxDepthY=$scrollBreakpointwiseItem[$deviceMode].parallaxDepthY; const $rotateX=$scrollItemSettings['wdt_sle_rotate_x'] ? Boolean($scrollItemSettings['wdt_sle_rotate_x']):false; const $rotateAngleX=$scrollBreakpointwiseItem[$deviceMode].rotateAngleX; const $rotateY=$scrollItemSettings['wdt_sle_rotate_y'] ? Boolean($scrollItemSettings['wdt_sle_rotate_y']):false; const $rotateAngleY=$scrollBreakpointwiseItem[$deviceMode].rotateAngleY; const $rotateZ=$scrollItemSettings['wdt_sle_rotate_z'] ? Boolean($scrollItemSettings['wdt_sle_rotate_z']):false; const $rotateAngleZ=$scrollBreakpointwiseItem[$deviceMode].rotateAngleZ; const $scale=$scrollItemSettings['wdt_sle_scale'] ? Boolean($scrollItemSettings['wdt_sle_scale']):false; const $scaleValue=$scrollBreakpointwiseItem[$deviceMode].scaleValue; const $blur=$scrollItemSettings['wdt_sle_blur'] ? Boolean($scrollItemSettings['wdt_sle_blur']):false; const $blurValue=$scrollBreakpointwiseItem[$deviceMode].blurValue; const $opacity=$scrollItemSettings['wdt_sle_opacity'] ? Boolean($scrollItemSettings['wdt_sle_opacity']):false; const $opacityValue=$scrollBreakpointwiseItem[$deviceMode].opacityValue; const $itemTop=+$scope.find('.wdt-effect-scroll-wrapper').offset().top; const $itemHeight=+$scope.find('.wdt-effect-scroll-wrapper .wdt-section-bgeffects-image').height(); const $toScroll=($itemTop + $itemHeight); const $windowHeight=$window.height(); const $fromScroll=($itemTop - $windowHeight); if($parallaxDirectionX){ $scope.find('.wdt-effect-scroll-wrapper .wdt-section-bgeffects-image').css({ 'left': '-'+$parallaxDepthX+'px' }) }else if($parallaxDirectionY){ $scope.find('.wdt-effect-scroll-wrapper .wdt-section-bgeffects-image').css({ 'top': '-'+$parallaxDepthY+'px' }) } let $options={'distance': 10, 'smoothness': 30, 'from-scroll': $fromScroll, 'to-scroll': $toScroll}; if($parallaxDirectionX){ $options['x']=$parallaxDepthX; } if($parallaxDirectionY){ $options['y']=$parallaxDepthY; } if($rotateX){ $options['rotateX']=$rotateAngleX; } if($rotateY){ $options['rotateY']=$rotateAngleY; } if($rotateZ){ $options['rotateZ']=$rotateAngleZ; } if($scale){ $options['scale']=$scaleValue; } if($blur){ $options['blur']=$blurValue; } if($opacity){ $options['opacity']=$opacityValue; } $scope.find('.wdt-effect-scroll-wrapper').attr('data-parallax', JSON.stringify($options)); };}; $(window).on('elementor/frontend/init', function (){ elementorFrontend.hooks.addAction('frontend/element_ready/section', wdtSectionsOptionsHandler); }); })(jQuery); !function(a){({showLogs:!1,round:1e3,init:function(){if(this._log("init"),this._inited)return this._log("Already Inited"),void(this._inited=!0);this._requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a,t){window.setTimeout(a,1e3/60)},this._onScroll(!0)},_inited:!1,_properties:["x","y","z","rotateX","rotateY","rotateZ","scaleX","scaleY","scaleZ","scale","blur","opacity"],_requestAnimationFrame:null,_log:function(a){this.showLogs&&console.log("Parallax Scroll / "+a)},_onScroll:function(t){var e=a(document).scrollTop(),l=a(window).height();this._log("onScroll "+e),a("[data-parallax]").each(a.proxy(function(n,r){var s=a(r),i=[],o=!1,c=s.data("style");null==c&&(c=s.attr("style")||"",s.data("style",c));var u,d=[s.data("parallax")];for(u=2;s.data("parallax"+u);u++)d.push(s.data("parallax"+u));var m=d.length;for(u=0;uh&&("back"==s.data("sens")?(_=1,s.data("sens","go")):_++),A0&&_<=g){var u=e;"back"==s.data("sens")&&(u=l,l=-l,f=y,g=x),c=a.easing[f](null,_,u,l,g)}(c=Math.ceil(c*this.round)/this.round)==n&&r==l&&(c=l),i[t]||(i[t]=0),i[t]+=c,n!=i[t]&&(s.data("_"+t,i[t]),o=!0)}},this))}if(o){if(null!=i.z){var X=p.perspective;null==X&&(X=800);var Y=s.parent();Y.data("style")||Y.data("style",Y.attr("style")||""),Y.attr("style","perspective:"+X+"px; -webkit-perspective:"+X+"px; "+Y.data("style"))}null==i.scaleX&&(i.scaleX=1),null==i.scaleY&&(i.scaleY=1),null==i.scaleZ&&(i.scaleZ=1),null!=i.scale&&(i.scaleX*=i.scale,i.scaleY*=i.scale,i.scaleZ*=i.scale);var Z="translate3d("+(i.x?i.x:0)+"px, "+(i.y?i.y:0)+"px, "+(i.z?i.z:0)+"px)"+" "+("rotateX("+(i.rotateX?i.rotateX:0)+"deg) rotateY("+(i.rotateY?i.rotateY:0)+"deg) rotateZ("+(i.rotateZ?i.rotateZ:0)+"deg)")+" "+("scaleX("+i.scaleX+") scaleY("+i.scaleY+") scaleZ("+i.scaleZ+")")+";";this._log(Z);var q="";if(null!=i.blur){var F="blur("+i.blur+"px);";q="filter:"+F+" -webkit-filter:"+F}var k="";null!=i.opacity&&(k="opacity:"+i.opacity+";"),s.attr("style","transform:"+Z+" -webkit-transform:"+Z+" "+q+" "+k+" "+c)}},this)),window.requestAnimationFrame?window.requestAnimationFrame(a.proxy(this._onScroll,this,!1)):this._requestAnimationFrame(a.proxy(this._onScroll,this,!1))}}).init()}(jQuery); !function(r,u,d,m){"use strict";var o="parallax",n={relativeInput:!1,clipRelativeInput:!1,calibrationThreshold:100,calibrationDelay:500,supportDelay:500,calibrateX:!1,calibrateY:!0,invertX:!0,invertY:!0,limitX:!1,limitY:!1,scalarX:10,scalarY:10,frictionX:.1,frictionY:.1,originX:.5,originY:.5,pointerEvents:!0,precision:1};function a(t,i){this.element=t,this.$context=r(t).data("api",this),this.$layers=this.$context.find(".layer");var e={calibrateX:this.$context.data("calibrate-x")||null,calibrateY:this.$context.data("calibrate-y")||null,invertX:this.$context.data("invert-x")||null,invertY:this.$context.data("invert-y")||null,limitX:parseFloat(this.$context.data("limit-x"))||null,limitY:parseFloat(this.$context.data("limit-y"))||null,scalarX:parseFloat(this.$context.data("scalar-x"))||null,scalarY:parseFloat(this.$context.data("scalar-y"))||null,frictionX:parseFloat(this.$context.data("friction-x"))||null,frictionY:parseFloat(this.$context.data("friction-y"))||null,originX:parseFloat(this.$context.data("origin-x"))||null,originY:parseFloat(this.$context.data("origin-y"))||null,pointerEvents:this.$context.data("pointer-events")||!0,precision:parseFloat(this.$context.data("precision"))||1};for(var s in e)null===e[s]&&delete e[s];r.extend(this,n,i,e),this.calibrationTimer=null,this.calibrationFlag=!0,this.enabled=!1,this.depthsX=[],this.depthsY=[],this.raf=null,this.bounds=null,this.ex=0,this.ey=0,this.ew=0,this.eh=0,this.ecx=0,this.ecy=0,this.erx=0,this.ery=0,this.cx=0,this.cy=0,this.ix=0,this.iy=0,this.mx=0,this.my=0,this.vx=0,this.vy=0,this.onMouseMove=this.onMouseMove.bind(this),this.onDeviceOrientation=this.onDeviceOrientation.bind(this),this.onOrientationTimer=this.onOrientationTimer.bind(this),this.onCalibrationTimer=this.onCalibrationTimer.bind(this),this.onAnimationFrame=this.onAnimationFrame.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.initialise()}a.prototype.transformSupport=function(t){for(var i,e,s,o,n=d.createElement("div"),r=!1,a=null,h=!1,l=null,p=null,c=0,y=this.vendors.length;cthis.calibrationThreshold||Math.abs(i)>this.calibrationThreshold)&&this.queueCalibration(0),this.portrait?(this.mx=this.calibrateX?i:this.iy,this.my=this.calibrateY?t:this.ix):(this.mx=this.calibrateX?t:this.ix,this.my=this.calibrateY?i:this.iy),this.mx*=this.ew*(this.scalarX/100),this.my*=this.eh*(this.scalarY/100),isNaN(parseFloat(this.limitX))||(this.mx=this.clamp(this.mx,-this.limitX,this.limitX)),isNaN(parseFloat(this.limitY))||(this.my=this.clamp(this.my,-this.limitY,this.limitY)),this.vx+=(this.mx-this.vx)*this.frictionX,this.vy+=(this.my-this.vy)*this.frictionY;for(var e=0,s=this.$layers.length;eu.innerWidth,this.portrait!==s&&(this.portrait=s,this.calibrationFlag=!0),this.calibrationFlag&&(this.calibrationFlag=!1,this.cx=i,this.cy=e),this.ix=i,this.iy=e)},a.prototype.onMouseMove=function(t){var i=t.clientX,e=t.clientY;!this.orientationSupport&&this.relativeInput?(this.clipRelativeInput&&(i=Math.max(i,this.ex),i=Math.min(i,this.ex+this.ew),e=Math.max(e,this.ey),e=Math.min(e,this.ey+this.eh)),this.ix=(i-this.ex-this.ecx)/this.erx,this.iy=(e-this.ey-this.ecy)/this.ery):(this.ix=(i-this.wcx)/this.wrx,this.iy=(e-this.wcy)/this.wry)};var h={enable:a.prototype.enable,disable:a.prototype.disable,updateLayers:a.prototype.updateLayers,calibrate:a.prototype.calibrate,friction:a.prototype.friction,invert:a.prototype.invert,scalar:a.prototype.scalar,limit:a.prototype.limit,origin:a.prototype.origin};r.fn[o]=function(e){var s=arguments;return this.each(function(){var t=r(this),i=t.data(o);i||(i=new a(this,e),t.data(o,i)),h[e]&&i[e].apply(i,Array.prototype.slice.call(s,1))})}}(window.jQuery||window.Zepto,window,document); (function ($){ const wdtWidgetsOptionsHandler=function($scope){ const animationEffectInstance=new wdtWidgetsAnimationEffectHandlerInit($scope); animationEffectInstance.init(); const inviewInstance=new wdtWidgetsInViewHandlerInit($scope); inviewInstance.init(); }; const wdtWidgetsAnimationEffectHandlerInit=function($scope){ const $self=this, $window=$(window), $widgetId=$scope.data('id'), $editMode=Boolean(elementorFrontend.isEditMode()), $activeBreakpoints=elementorFrontend.config.responsive.activeBreakpoints, $deviceMode=elementorFrontend.getCurrentDeviceMode(); let $parallaxInstance; let $activeBreakpointkeys=[]; let $animationEffectSettings=false; let $animationEffectBreakpointSettings=[]; let $autoMoveElement; $self.init=function(){ $self.animationEffectInit(); }; $self.animationEffectInit=function(){ if($editMode){ $animationEffectSettings=$self.generateEditorSettings($widgetId); }else{ $animationEffectSettings=$scope.data('settings')||false; $animationEffectSettings=(false!==$animationEffectSettings) ? $animationEffectSettings:false; } if(!$animationEffectSettings||$animationEffectSettings['wdt_animation_effect']==='none'){ return false; } $self.updateActiveBreakpoints(); if($animationEffectSettings['wdt_animation_effect']==='mouse-move'){ $self.animationEffectMouseMove(); } if($animationEffectSettings['wdt_animation_effect']==='scroll'){ $self.animationEffectScroll(); } if($animationEffectSettings['wdt_animation_effect']==='auto-movement'){ $self.animationEffectAutoMovement(); } if($animationEffectSettings['wdt_animation_effect']==='marquee'){ $self.animationEffectMarquee(); }}; $self.generateEditorSettings=function($widgetId){ let $editorModels=null; let $editorSettings={}; if(!window.elementor.hasOwnProperty('elements')){ return false; } $editorModels=window.elementor.elements.models; if(!$editorModels){ return false; } $.each($editorModels, function(index, obj){ $.each(obj.attributes.elements.models, function(index, obj){ $.each(obj.attributes.elements.models, function(index, obj){ if($widgetId===obj.id){ $editorSettings=obj.attributes.settings.attributes; }}); }); }); let $wdtEditorKeys=Object.keys($editorSettings).filter((key)=> key.includes('wdt')); let $wdtEditorSettings=$wdtEditorKeys.reduce((cur, key)=> { return Object.assign(cur, { [key]: $editorSettings[key] })}, {}); let $customDirections=[]; if($wdtEditorSettings['wdt_ame_custom_directions']){ $.each($wdtEditorSettings['wdt_ame_custom_directions'].models, function(index, obj){ let $customDirection=obj.attributes; $customDirections.push($customDirection); }); } $wdtEditorSettings['wdt_ame_custom_directions']=$customDirections; return $wdtEditorSettings; }; $self.updateActiveBreakpoints=function(){ $.each($activeBreakpoints, function (key, value){ if('widescreen'===key){ $activeBreakpointkeys.push('desktop'); $activeBreakpointkeys.push(key); }else{ $activeBreakpointkeys.push(key); }}); if(-1===$activeBreakpointkeys.indexOf('widescreen')){ $activeBreakpointkeys.push('desktop'); }}; $self.getMouseMoveResponsiveSettings=function(){ $activeBreakpointkeys.forEach(function($breakpoint){ if('desktop'===$breakpoint){ $animationEffectBreakpointSettings[$breakpoint]={ 'speed':($animationEffectSettings['wdt_mme_speed']['size']&&''!=$animationEffectSettings['wdt_mme_speed']['size']) ? $animationEffectSettings['wdt_mme_speed']['size']:0.1, 'depth':($animationEffectSettings['wdt_mme_depth']['size']&&''!=$animationEffectSettings['wdt_mme_depth']['size']) ? $animationEffectSettings['wdt_mme_depth']['size']:1 };}else{ $animationEffectBreakpointSettings[$breakpoint]={ 'speed':($animationEffectSettings['wdt_mme_speed_' + $breakpoint]['size']&&''!=$animationEffectSettings['wdt_mme_speed_' + $breakpoint]['size']) ? $animationEffectSettings['wdt_mme_speed_' + $breakpoint]['size']:$animationEffectSettings['wdt_mme_speed']['size'], 'depth':($animationEffectSettings['wdt_mme_depth_' + $breakpoint]['size']&&''!=$animationEffectSettings['wdt_mme_depth_' + $breakpoint]['size']) ? $animationEffectSettings['wdt_mme_depth_' + $breakpoint]['size']:$animationEffectSettings['wdt_mme_depth']['size'] };}}); }; $self.animationEffectMouseMove=function(){ $self.getMouseMoveResponsiveSettings(); if(!$animationEffectBreakpointSettings[$deviceMode]){ return false; } const $speed=$animationEffectBreakpointSettings[$deviceMode].speed; const $depth=$animationEffectBreakpointSettings[$deviceMode].depth; const $moveAlong=$animationEffectSettings['wdt_mme_move_along'] ? $animationEffectSettings['wdt_mme_move_along']:'both'; const $invertMovement=$animationEffectSettings['wdt_mme_invert_movement'] ? Boolean($animationEffectSettings['wdt_mme_invert_movement']):false; let $options={}; $scope.find('.elementor-widget-container').wrapInner('
') $scope.find('.wdt-effect-mouse-move-wrapper').attr('data-depth', $depth); if($moveAlong==='x-axis'){ $options['scalarX']=10.0; $options['scalarY']=0.0; } if($moveAlong==='y-axis'){ $options['scalarX']=0.0; $options['scalarY']=10.0; } if($moveAlong==='both'){ $options['scalarX']=10.0; $options['scalarY']=10.0; } $options['frictionX']=$speed; $options['frictionY']=$speed; $options['invertX']=$invertMovement; $options['invertY']=$invertMovement; $parallaxInstance=$scope.parallax($options); }; $self.getScrollResponsiveSettings=function(){ let $wdt_sle_parallax_x_depth=($animationEffectSettings['wdt_sle_parallax_x_depth']&&''!=$animationEffectSettings['wdt_sle_parallax_x_depth']['size']) ? $animationEffectSettings['wdt_sle_parallax_x_depth']['size']:50; let $wdt_sle_parallax_y_depth=($animationEffectSettings['wdt_sle_parallax_y_depth']&&''!=$animationEffectSettings['wdt_sle_parallax_y_depth']['size']) ? $animationEffectSettings['wdt_sle_parallax_y_depth']['size']:50; let $wdt_sle_rotate_x_angle=($animationEffectSettings['wdt_sle_rotate_x_angle']&&''!=$animationEffectSettings['wdt_sle_rotate_x_angle']['size']) ? $animationEffectSettings['wdt_sle_rotate_x_angle']['size']:45; let $wdt_sle_rotate_y_angle=($animationEffectSettings['wdt_sle_rotate_y_angle']&&''!=$animationEffectSettings['wdt_sle_rotate_y_angle']['size']) ? $animationEffectSettings['wdt_sle_rotate_y_angle']['size']:45; let $wdt_sle_rotate_z_angle=($animationEffectSettings['wdt_sle_rotate_z_angle']&&''!=$animationEffectSettings['wdt_sle_rotate_z_angle']['size']) ? $animationEffectSettings['wdt_sle_rotate_z_angle']['size']:45; let $wdt_sle_scale_value=($animationEffectSettings['wdt_sle_scale_value']&&''!=$animationEffectSettings['wdt_sle_scale_value']['size']) ? $animationEffectSettings['wdt_sle_scale_value']['size']:1; let $wdt_sle_blur_value=($animationEffectSettings['wdt_sle_blur_value']&&''!=$animationEffectSettings['wdt_sle_blur_value']['size']) ? $animationEffectSettings['wdt_sle_blur_value']['size']:0; let $wdt_sle_opacity_value=($animationEffectSettings['wdt_sle_opacity_value']&&''!=$animationEffectSettings['wdt_sle_opacity_value']['size']) ? $animationEffectSettings['wdt_sle_opacity_value']['size']:1; $activeBreakpointkeys.forEach(function($breakpoint){ if('desktop'===$breakpoint){ $animationEffectBreakpointSettings[$breakpoint]={ 'parallaxDepthX': $wdt_sle_parallax_x_depth, 'parallaxDepthY': $wdt_sle_parallax_y_depth, 'rotateAngleX':$wdt_sle_rotate_x_angle, 'rotateAngleY':$wdt_sle_rotate_y_angle, 'rotateAngleZ':$wdt_sle_rotate_z_angle, 'scaleValue':$wdt_sle_scale_value, 'blurValue':$wdt_sle_blur_value, 'opacityValue':$wdt_sle_opacity_value };}else{ $animationEffectBreakpointSettings[$breakpoint]={ 'parallaxDepthX':($animationEffectSettings['wdt_sle_parallax_x_depth_' + $breakpoint]&&''!=$animationEffectSettings['wdt_sle_parallax_x_depth_' + $breakpoint]['size']) ? $animationEffectSettings['wdt_sle_parallax_x_depth_' + $breakpoint]['size']:$wdt_sle_parallax_x_depth, 'parallaxDepthY':($animationEffectSettings['wdt_sle_parallax_y_depth_' + $breakpoint]&&''!=$animationEffectSettings['wdt_sle_parallax_y_depth_' + $breakpoint]['size']) ? $animationEffectSettings['wdt_sle_parallax_y_depth_' + $breakpoint]['size']:$wdt_sle_parallax_y_depth, 'rotateAngleX':($animationEffectSettings['wdt_sle_rotate_x_angle_' + $breakpoint]&&''!=$animationEffectSettings['wdt_sle_rotate_x_angle_' + $breakpoint]['size']) ? $animationEffectSettings['wdt_sle_rotate_x_angle_' + $breakpoint]['size']:$wdt_sle_rotate_x_angle, 'rotateAngleY':($animationEffectSettings['wdt_sle_rotate_y_angle_' + $breakpoint]&&''!=$animationEffectSettings['wdt_sle_rotate_y_angle_' + $breakpoint]['size']) ? $animationEffectSettings['wdt_sle_rotate_y_angle_' + $breakpoint]['size']:$wdt_sle_rotate_y_angle, 'rotateAngleZ':($animationEffectSettings['wdt_sle_rotate_z_angle_' + $breakpoint]&&''!=$animationEffectSettings['wdt_sle_rotate_z_angle_' + $breakpoint]['size']) ? $animationEffectSettings['wdt_sle_rotate_z_angle_' + $breakpoint]['size']:$wdt_sle_rotate_z_angle, 'scaleValue':($animationEffectSettings['wdt_sle_scale_value_' + $breakpoint]&&''!=$animationEffectSettings['wdt_sle_scale_value_' + $breakpoint]['size']) ? $animationEffectSettings['wdt_sle_scale_value_' + $breakpoint]['size']:$wdt_sle_scale_value, 'blurValue':($animationEffectSettings['wdt_sle_blur_value_' + $breakpoint]&&''!=$animationEffectSettings['wdt_sle_blur_value_' + $breakpoint]['size']) ? $animationEffectSettings['wdt_sle_blur_value_' + $breakpoint]['size']:$wdt_sle_blur_value, 'opacityValue':($animationEffectSettings['wdt_sle_opacity_value' + $breakpoint]&&''!=$animationEffectSettings['wdt_sle_opacity_value' + $breakpoint]['size']) ? $animationEffectSettings['wdt_sle_opacity_value' + $breakpoint]['size']:$wdt_sle_opacity_value, };}}); }; $self.animationEffectScroll=function(){ $self.getScrollResponsiveSettings(); if(!$animationEffectBreakpointSettings[$deviceMode]){ return false; } $scope.find('.elementor-widget-container').wrapInner('
') const $parallaxDirectionX=$animationEffectSettings['wdt_sle_parallax_x_direction'] ? Boolean($animationEffectSettings['wdt_sle_parallax_x_direction']):false; const $parallaxDepthX=$animationEffectBreakpointSettings[$deviceMode].parallaxDepthX; const $parallaxDirectionY=$animationEffectSettings['wdt_sle_parallax_y_direction'] ? Boolean($animationEffectSettings['wdt_sle_parallax_y_direction']):false; const $parallaxDepthY=$animationEffectBreakpointSettings[$deviceMode].parallaxDepthY; const $rotateX=$animationEffectSettings['wdt_sle_rotate_x'] ? Boolean($animationEffectSettings['wdt_sle_rotate_x']):false; const $rotateAngleX=$animationEffectBreakpointSettings[$deviceMode].rotateAngleX; const $rotateY=$animationEffectSettings['wdt_sle_rotate_y'] ? Boolean($animationEffectSettings['wdt_sle_rotate_y']):false; const $rotateAngleY=$animationEffectBreakpointSettings[$deviceMode].rotateAngleY; const $rotateZ=$animationEffectSettings['wdt_sle_rotate_z'] ? Boolean($animationEffectSettings['wdt_sle_rotate_z']):false; const $rotateAngleZ=$animationEffectBreakpointSettings[$deviceMode].rotateAngleZ; const $scale=$animationEffectSettings['wdt_sle_scale'] ? Boolean($animationEffectSettings['wdt_sle_scale']):false; const $scaleValue=$animationEffectBreakpointSettings[$deviceMode].scaleValue; const $blur=$animationEffectSettings['wdt_sle_blur'] ? Boolean($animationEffectSettings['wdt_sle_blur']):false; const $blurValue=$animationEffectBreakpointSettings[$deviceMode].blurValue; const $opacity=$animationEffectSettings['wdt_sle_opacity'] ? Boolean($animationEffectSettings['wdt_sle_opacity']):false; const $opacityValue=$animationEffectBreakpointSettings[$deviceMode].opacityValue; const $itemTop=+$scope.find('.wdt-effect-scroll-wrapper').offset().top; const $itemHeight=+$scope.find('.wdt-effect-scroll-wrapper').height(); const $toScroll=($itemTop + $itemHeight); const $windowHeight=$window.height(); const $fromScroll=($itemTop - $windowHeight); let $options={'distance': 10, 'smoothness': 30, 'from-scroll': $fromScroll, 'to-scroll': $toScroll}; if($parallaxDirectionX){ $options['x']=$parallaxDepthX; } if($parallaxDirectionY){ $options['y']=$parallaxDepthY; } if($rotateX){ $options['rotateX']=$rotateAngleX; } if($rotateY){ $options['rotateY']=$rotateAngleY; } if($rotateZ){ $options['rotateZ']=$rotateAngleZ; } if($scale){ $options['scale']=$scaleValue; } if($blur){ $options['blur']=$blurValue; } if($opacity){ $options['opacity']=$opacityValue; } $scope.find('.wdt-effect-scroll-wrapper').attr('data-parallax', JSON.stringify($options)); }; $self.autoMovementOnIntersect=function(entries, $observer){ entries.forEach((entry)=> { if(entry.isIntersecting){ $autoMoveElement.play(); }else{ $autoMoveElement.pause(); }}); } $self.generateResponsiveRandomPoints=function($direction){ let $reponsiveRandoms={}; let $wdt_x_depth=($direction['wdt_x_depth']&&''!=$direction['wdt_x_depth']['size']) ? $direction['wdt_x_depth']['size']:0; let $wdt_y_depth=($direction['wdt_y_depth']&&''!=$direction['wdt_y_depth']['size']) ? $direction['wdt_y_depth']['size']:0; let $wdt_rotate_angle=($direction['wdt_rotate_angle']&&''!=$direction['wdt_rotate_angle']['size']) ? $direction['wdt_rotate_angle']['size']:0; let $wdt_scale_value=($direction['wdt_scale_value']&&''!=$direction['wdt_scale_value']['size']) ? $direction['wdt_scale_value']['size']:1; let $wdt_blur_value=($direction['wdt_blur_value']&&''!=$direction['wdt_blur_value']['size']) ? $direction['wdt_blur_value']['size']:0; let $wdt_opacity_value=($direction['wdt_opacity_value']&&''!=$direction['wdt_opacity_value']['size']) ? $direction['wdt_opacity_value']['size']:1; $activeBreakpointkeys.forEach(function($breakpoint){ if('desktop'===$breakpoint){ $reponsiveRandoms[$breakpoint]={ 'depthX':$wdt_x_depth, 'depthY':$wdt_y_depth, 'rotateAngle':$wdt_rotate_angle, 'scaleValue':$wdt_scale_value, 'blurValue':$wdt_blur_value, 'opacityValue': $wdt_opacity_value };}else{ $reponsiveRandoms[$breakpoint]={ 'depthX':($direction['wdt_x_depth_' + $breakpoint]&&''!=$direction['wdt_x_depth_' + $breakpoint]['size']) ? $direction['wdt_x_depth_' + $breakpoint]['size']:$wdt_x_depth, 'depthY':($direction['wdt_y_depth_' + $breakpoint]&&''!=$direction['wdt_y_depth_' + $breakpoint]['size']) ? $direction['wdt_y_depth_' + $breakpoint]['size']:$wdt_y_depth, 'rotateAngle':($direction['wdt_rotate_angle_' + $breakpoint]&&''!=$direction['wdt_rotate_angle_' + $breakpoint]['size']) ? $direction['wdt_rotate_angle_' + $breakpoint]['size']:$wdt_rotate_angle, 'scaleValue':($direction['wdt_scale_value_' + $breakpoint]&&''!=$direction['wdt_scale_value_' + $breakpoint]['size']) ? $direction['wdt_scale_value_' + $breakpoint]['size']:$wdt_scale_value, 'blurValue':($direction['wdt_blur_value_' + $breakpoint]&&''!=$direction['wdt_blur_value_' + $breakpoint]['size']) ? $direction['wdt_blur_value_' + $breakpoint]['size']:$wdt_blur_value, 'opacityValue':($direction['wdt_opacity_value' + $breakpoint]&&''!=$direction['wdt_opacity_value' + $breakpoint]['size']) ? $direction['wdt_opacity_value' + $breakpoint]['size']:$wdt_opacity_value, };}}); return $reponsiveRandoms; }; $self.generateRandomPoints=function($ameCustomDirections){ let $points=[]; $ameCustomDirections.forEach(($direction)=> { let $unitPoint={}; const $responsiveDirections=$self.generateResponsiveRandomPoints($direction); $unitPoint={ transform: '' }; const $xDirection=$direction['wdt_x_direction'] ? Boolean($direction['wdt_x_direction']):false; const $depthX=$responsiveDirections[$deviceMode].depthX; const $yDirection=$direction['wdt_y_direction'] ? Boolean($direction['wdt_y_direction']):false; const $depthY=$responsiveDirections[$deviceMode].depthY; const $rotate=$direction['wdt_rotate'] ? Boolean($direction['wdt_rotate']):false; const $rotateAngle=$responsiveDirections[$deviceMode].rotateAngle; const $scale=$direction['wdt_scale'] ? Boolean($direction['wdt_scale']):false; const $scaleValue=$responsiveDirections[$deviceMode].scaleValue; if($xDirection){ $unitPoint['transform'] +='translateX('+$depthX+'px) '; } if($yDirection){ $unitPoint['transform'] +='translateY('+$depthY+'px) '; } if($rotate){ $unitPoint['transform'] +='rotate('+$rotateAngle+'deg) '; } if($scale){ $unitPoint['transform'] +='scale('+$scaleValue+') '; } $unitPoint['transform']=$.trim($unitPoint['transform']) $unitPoint['opacity']=0.2; const $blur=$direction['wdt_blur'] ? Boolean($direction['wdt_blur']):false; const $blurValue=$responsiveDirections[$deviceMode].blurValue; if($blur){ $unitPoint['filter']='blur('+$blurValue+'px)'; } const $opacity=$direction['wdt_opacity'] ? Boolean($direction['wdt_opacity']):false; const $opacityValue=$responsiveDirections[$deviceMode].opacityValue; if($opacity){ $unitPoint['opacity']=+$opacityValue; } if($unitPoint){ $points.push($unitPoint); }}); return $points; } $self.animationEffectAutoMovement=function(){ $scope.find('.elementor-widget-container').wrapInner('
') let $autoMoveElementItem=$scope.find('.wdt-effect-auto-movement-wrapper')[0]; let $ameDirection=$animationEffectSettings['wdt_ame_direction']; let $ameDuration=$animationEffectSettings['wdt_ame_duration']['size'] ? Math.ceil($animationEffectSettings['wdt_ame_duration']['size']*1500):10000; let $ameIteration=($animationEffectSettings['wdt_ame_iteration']==='infinity') ? Infinity:1; let $boundTo=$animationEffectSettings['wdt_bound_to'] ? $animationEffectSettings['wdt_bound_to']:'section'; let $boundToElement=($boundTo==='section') ? $scope.parents('.elementor-section'):$scope.parents('.elementor-column'); let $itemWidth=+$scope.find('.wdt-effect-auto-movement-wrapper').width(); let $sectionWidth=+$boundToElement.width(); let $sectionItemWidth=+$sectionWidth + +$itemWidth; let $itemHeight=+$scope.find('.wdt-effect-auto-movement-wrapper').height(); let $sectionHeight=+$boundToElement.height(); let $sectionItemHeight=+$sectionHeight + +$itemHeight; if($ameDirection==='left-to-right'){ $autoMoveElement=$autoMoveElementItem.animate([ { transform: 'translateX(-'+$itemWidth+'px)' }, { transform: 'translateX('+$sectionWidth+'px)' } ], { duration: $ameDuration, iterations: $ameIteration }); $autoMoveElement.pause(); }else if($ameDirection==='right-to-left'){ $autoMoveElement=$autoMoveElementItem.animate([ { transform: 'translateX('+$sectionItemWidth+'px)' }, { transform: 'translateX(-'+$itemWidth+'px)' } ], { duration: $ameDuration, iterations: $ameIteration }); $autoMoveElement.pause(); }else if($ameDirection==='top-to-bottom'){ $autoMoveElement=$autoMoveElementItem.animate([ { transform: 'translateY(-'+$itemHeight+'px)' }, { transform: 'translateY('+$sectionHeight+'px)' } ], { duration: $ameDuration, iterations: $ameIteration }); $autoMoveElement.pause(); }else if($ameDirection==='bottom-to-top'){ $autoMoveElement=$autoMoveElementItem.animate([ { transform: 'translateY('+$sectionItemHeight+'px)' }, { transform: 'translateY(-'+$itemHeight+'px)' } ], { duration: $ameDuration, iterations: $ameIteration }); $autoMoveElement.pause(); }else if($ameDirection==='custom'){ let $ameCustomDirections=$animationEffectSettings['wdt_ame_custom_directions']; if($ameCustomDirections.length){ let $ameCustomDirectionPoints=$self.generateRandomPoints($ameCustomDirections); $autoMoveElement=$autoMoveElementItem.animate($ameCustomDirectionPoints, { duration: $ameDuration, iterations: $ameIteration }); $autoMoveElement.pause(); }} if('IntersectionObserver' in window){ let $observer; let $observerOptions={ root: null, rootMargin: "0px", threshold: 0.1 }; $observer=new IntersectionObserver($self.autoMovementOnIntersect, $observerOptions); $observer.observe($scope[0]); }else{ $autoMoveElement.play(); }}; $self.animationEffectMarquee=function(){ $scope.find('.elementor-widget-container').wrapInner('
') let $marqueeElementItem=$scope.find('.wdt-effect-marquee-wrapper'); let $width=$animationEffectSettings['wdt_mqe_width']['size'] ? $animationEffectSettings['wdt_mqe_width']['size']:200; let $height=$animationEffectSettings['wdt_mqe_height']['size'] ? $animationEffectSettings['wdt_mqe_height']['size']:120; let $speed=$animationEffectSettings['wdt_mqe_speed']['size'] ? $animationEffectSettings['wdt_mqe_speed']['size']:1; let $direction=$animationEffectSettings['wdt_mqe_direction'] ? $animationEffectSettings['wdt_mqe_direction']:'left-to-right'; let $boundTo=$animationEffectSettings['wdt_mqe_bound_to'] ? $animationEffectSettings['wdt_mqe_bound_to']:'section'; let $boundToElement=($boundTo==='section') ? $scope.parents('.elementor-section'):$scope.parents('.elementor-column'); $marqueeElementItem.css({ 'position': 'absolute', 'width': $width, 'height': $height }); const $itemWidth=$marqueeElementItem.width(); const $itemOffset=$marqueeElementItem.offset(); const $itemOffsetLeft=$itemOffset.left; const $parentWidth=$boundToElement.width(); const $parentOffset=$boundToElement.offset(); const $parentOffsetLeft=$parentOffset.left; if($direction=='right-to-left'){ let $itemInitPosition=0; const $leftDiff=parseFloat($itemOffsetLeft) - parseFloat($parentOffsetLeft); const $rightPositionX=parseFloat($parentWidth) - parseFloat($leftDiff); let $leftOffset=parseFloat($leftDiff) + parseFloat($itemWidth); $leftOffset='-' + parseFloat($leftOffset); function animationLoop(){ $itemInitPosition=$itemInitPosition - $speed; $marqueeElementItem.css({ 'left': $itemInitPosition + 'px' }); $frameRtlID=window.requestAnimationFrame(animationLoop); if($itemInitPosition <=$leftOffset){ window.cancelAnimationFrame($frameRtlID); $itemInitPosition=$rightPositionX; $frameRtlID=window.requestAnimationFrame(animationLoop); }} let $frameRtlID=window.requestAnimationFrame(animationLoop); }else{ let $itemInitPosition=0; const $leftDiff=parseFloat($itemOffsetLeft) - parseFloat($parentOffsetLeft); const $maxPositionWidth=parseFloat($leftDiff) + parseFloat($itemWidth); const $maxPositionX=parseFloat($parentWidth) - parseFloat($maxPositionWidth) + parseFloat($itemWidth); const $loopPositionX=parseFloat($leftDiff) + parseFloat($itemWidth); function animationLoop(){ $itemInitPosition=$itemInitPosition + $speed; $marqueeElementItem.css({ 'left': $itemInitPosition + 'px' }); $frameLtrID=window.requestAnimationFrame(animationLoop); if($itemInitPosition >=$maxPositionX){ window.cancelAnimationFrame($frameLtrID); $itemInitPosition=-$loopPositionX; $frameLtrID=window.requestAnimationFrame(animationLoop); }} let $frameLtrID=window.requestAnimationFrame(animationLoop); }};}; const wdtWidgetsInViewHandlerInit=function($scope){ const $self=this, $window=$(window), $widgetId=$scope.data('id'), $editMode=Boolean(elementorFrontend.isEditMode()); let $inViewSettings=false; let $inViewLoop=false; let $inViewElement=$scope[0]; $self.init=function(){ $self.inViewStatusUpdateInit(); }; $self.inViewStatusUpdateInit=function(){ if($editMode){ $inViewSettings=$self.generateEditorSettings($widgetId); }else{ $inViewSettings=$scope.data('settings')||false; $inViewSettings=(false!==$inViewSettings) ? $inViewSettings:false; } if(!$inViewSettings||!$inViewSettings['wdt_enable_inview_status']){ return false; } $inViewLoop=$inViewSettings['wdt_enable_inview_loop']; if('IntersectionObserver' in window){ $self.createObserver(); }}; $self.generateEditorSettings=function($widgetId){ let $editorModels=null; let $editorSettings={}; if(!window.elementor.hasOwnProperty('elements')){ return false; } $editorModels=window.elementor.elements.models; if(!$editorModels){ return false; } $.each($editorModels, function(index, obj){ $.each(obj.attributes.elements.models, function(index, obj){ $.each(obj.attributes.elements.models, function(index, obj){ if($widgetId===obj.id){ $editorSettings=obj.attributes.settings.attributes; }}); }); }); let $wdtEditorKeys=Object.keys($editorSettings).filter((key)=> key.includes('wdt')); let $wdtEditorSettings=$wdtEditorKeys.reduce((cur, key)=> { return Object.assign(cur, { [key]: $editorSettings[key] })}, {}); return $wdtEditorSettings; }; $self.createObserver=function(){ let $observer; let $options={ root: null, rootMargin: "0px", threshold: 1 }; $observer=new IntersectionObserver($self.handleIntersect, $options); $observer.observe($inViewElement); } $self.handleIntersect=function(entries, $observer){ entries.forEach((entry)=> { if(entry.isIntersecting){ entry.target.classList.add('wdt-item-is-inview'); }else{ if($inViewLoop){ entry.target.classList.remove('wdt-item-is-inview'); }} }); }}; $(window).on('elementor/frontend/init', function (){ elementorFrontend.hooks.addAction('frontend/element_ready/widget', wdtWidgetsOptionsHandler); }); })(jQuery); var debounce=function(t,e,a){var n;return function(){var r=this,u=arguments,i=a&&!n;clearTimeout(n),n=setTimeout((function(){n=null,a||t.apply(r,u)}),e),i&&t.apply(r,u)}};function returnCurrencySymbol(t=null){if(null===t)return"";let e={USD:"$",EUR:"€",CRC:"₡",GBP:"£",ILS:"₪",INR:"₹",JPY:"¥",KRW:"₩",NGN:"₦",PHP:"₱",PLN:"zł",PYG:"₲",THB:"฿",UAH:"₴",VND:"₫"};return void 0!==e[t]?e[t]:""}jQuery(document).ready((function(){jQuery(".bdt-ss-link").on("click",(function(){var t=jQuery("");jQuery("body").append(t),t.val(jQuery(this).data("url")).select(),document.execCommand ("copy"),t.remove(),jQuery(this).find(".bdt-social-share-title").html(jQuery(this).data("copied")),setTimeout(()=>{jQuery(this).find(".bdt-social-share-title").html(jQuery(this).data("orginal"))},5e3)}))})),jQuery(document).ajaxComplete((function(t,e,a){if(e.responseJSON&&void 0!==e.responseJSON.cart_hash&&e.responseJSON.cart_hash&&jQuery(".bdt-offcanvas").hasClass("__update_cart")){let t=jQuery(".bdt-offcanvas.__update_cart").attr("id");bdtUIkit.util.ready((function(){bdtUIkit.offcanvas("#"+t).show()}))}})); (()=>{"use strict";var e,r,n,a={},c={};function __webpack_require__(e){var r=c[e];if(void 0!==r)return r.exports;var n=c[e]={exports:{}};return a[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}__webpack_require__.m=a,e=[],__webpack_require__.O=(r,n,a,c)=>{if(!n){var i=1/0;for(o=0;o=c)&&Object.keys(__webpack_require__.O).every((e=>__webpack_require__.O[e](n[t])))?n.splice(t--,1):(_=!1,c0&&e[o-1][2]>c;o--)e[o]=e[o-1];e[o]=[n,a,c]},__webpack_require__.f={},__webpack_require__.e=e=>Promise.all(Object.keys(__webpack_require__.f).reduce(((r,n)=>(__webpack_require__.f[n](e,r),r)),[])),__webpack_require__.u=e=>714===e?"code-highlight.28a979661569ddbbf60d.bundle.min.js":721===e?"video-playlist.74fca1f2470fa6474595.bundle.min.js":256===e?"paypal-button.3d0d5af7df85963df32c.bundle.min.js":699===e?"60745ddf42fde6647dbc.bundle.min.js":156===e?"stripe-button.2acbca466dfeb9585680.bundle.min.js":241===e?"progress-tracker.e19e2547639d7d9dac17.bundle.min.js":26===e?"animated-headline.ffb4bb4ce1b16b11446d.bundle.min.js":534===e?"media-carousel.aca2224ef13e6f999011.bundle.min.js":369===e?"carousel.9b02b45d7826c1c48f33.bundle.min.js":804===e?"countdown.b0ef6392ec4ff09ca2f2.bundle.min.js":888===e?"hotspot.6ab1751404c381bfe390.bundle.min.js":680===e?"form.72b77b99d67b130634d2.bundle.min.js":121===e?"gallery.8ca9a354ce039d1ba641.bundle.min.js":288===e?"lottie.565b778d23c04461c4ea.bundle.min.js":42===e?"nav-menu.70d63d6d093f3a45a0c6.bundle.min.js":50===e?"popup.483b906ddaa1af17ff14.bundle.min.js":985===e?"load-more.064e7e640e7ef9c3fc30.bundle.min.js":287===e?"posts.e33113a212454e383747.bundle.min.js":824===e?"portfolio.042905bde20a1afccada.bundle.min.js":58===e?"share-buttons.81497e7fccd4fa77b6b9.bundle.min.js":114===e?"slides.fb6b9afd278bb9c5e75b.bundle.min.js":443===e?"social.2d2e44e8608690943f29.bundle.min.js":838===e?"table-of-contents.e42afd7d58cf06ab7a63.bundle.min.js":685===e?"archive-posts.80f1139e64eb8bd1a74a.bundle.min.js":858===e?"search-form.6eb419c467197ca411a7.bundle.min.js":102===e?"woocommerce-menu-cart.faa7b80e9ba9e5072070.bundle.min.js":1===e?"woocommerce-purchase-summary.46445ab1120a8c28c05c.bundle.min.js":124===e?"woocommerce-checkout-page.b18af78282979b6f74e4.bundle.min.js":859===e?"woocommerce-cart.fc30c6cb753d4098eff5.bundle.min.js":979===e?"woocommerce-my-account.3ee10d01e625dad87f73.bundle.min.js":497===e?"woocommerce-notices.da27b22c491f7cbe9158.bundle.min.js":800===e?"product-add-to-cart.023d7d31fbf96c3dbdfc.bundle.min.js":149===e?"loop.a9bed2dcd86eddf71249.bundle.min.js":153===e?"loop-carousel.4e8fd6593adbba21698e.bundle.min.js":356===e?"ajax-pagination.a2f9062c62a0ff30f25e.bundle.min.js":495===e?"mega-menu.f4e036531fed147c8f1f.bundle.min.js":157===e?"mega-menu-stretch-content.b203a97f096c18f3d1a2.bundle.min.js":244===e?"menu-title-keyboard-handler.ec514149d506e0fe9c54.bundle.min.js":209===e?"nested-carousel.9145d6891784d5818672.bundle.min.js":188===e?"taxonomy-filter.c1e2da2a112b3ab83ed8.bundle.min.js":void 0,__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},n="elementor-pro:",__webpack_require__.l=(e,a,c,i)=>{if(r[e])r[e].push(a);else{var _,t;if(void 0!==c)for(var b=document.getElementsByTagName("script"),o=0;o{_.onerror=_.onload=null,clearTimeout(d);var c=r[e];if(delete r[e],_.parentNode&&_.parentNode.removeChild(_),c&&c.forEach((e=>e(a))),n)return n(a)},d=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:_}),12e4);_.onerror=onScriptComplete.bind(null,_.onerror),_.onload=onScriptComplete.bind(null,_.onload),t&&document.head.appendChild(_)}},(()=>{var e;__webpack_require__.g.importScripts&&(e=__webpack_require__.g.location+"");var r=__webpack_require__.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var n=r.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),__webpack_require__.p=e})(),(()=>{var e={396:0};__webpack_require__.f.j=(r,n)=>{var a=__webpack_require__.o(e,r)?e[r]:void 0;if(0!==a)if(a)n.push(a[2]);else if(396!=r){var c=new Promise(((n,c)=>a=e[r]=[n,c]));n.push(a[2]=c);var i=__webpack_require__.p+__webpack_require__.u(r),_=new Error;__webpack_require__.l(i,(n=>{if(__webpack_require__.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var c=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;_.message="Loading chunk "+r+" failed.\n("+c+": "+i+")",_.name="ChunkLoadError",_.type=c,_.request=i,a[1](_)}}),"chunk-"+r,r)}else e[r]=0},__webpack_require__.O.j=r=>0===e[r];var webpackJsonpCallback=(r,n)=>{var a,c,[i,_,t]=n,b=0;if(i.some((r=>0!==e[r]))){for(a in _)__webpack_require__.o(_,a)&&(__webpack_require__.m[a]=_[a]);if(t)var o=t(__webpack_require__)}for(r&&r(n);b